OSDN Git Service

2010-02-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / template / error42.C
1 // PR c++/40372
2 // { dg-do compile }
3
4 template <int> struct A
5 {
6   int i;                // { dg-error "invalid use of non-static data member" }
7   friend void foo ()
8   {
9     int x[i];           // { dg-error "from this location" }
10   }
11 };
12
13 struct B
14 {
15   int j;                // { dg-error "invalid use of non-static data member" }
16   friend int bar ()
17   {
18     return j;           // { dg-error "from this location" }
19   }
20 };