summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/template/error42.C
blob: 0d651e3162028509685b75ada4fbf774c8a1f79a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// PR c++/40372
// { dg-do compile }

template <int> struct A
{
  int i;		// { dg-error "invalid use of non-static data member" }
  friend void foo ()
  {
    int x[i];		// { dg-error "from this location" }
  }
};

struct B
{
  int j;		// { dg-error "invalid use of non-static data member" }
  friend int bar ()
  {
    return j;		// { dg-error "from this location" }
  }
};