Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / g++.dg / template / memfriend16.C
bloba4eeafd79fec7e7331108db262ddbfd4e9c86ce5
1 // { dg-do compile }
3 // Copyright (C) 2004 Free Software Foundation
4 // Contributed by Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
6 // Nested class of class template as friend
8 template<class T> struct A
10   template <class U> struct B1
11   {
12   };
13   template <class U> struct B2
14   {
15     void f();
16   };
19 class C {
20   int i;        // { dg-error "private" }
21   template<class T> template <class U> friend struct A<T>::B1;
24 template<class T> template <class U> void A<T>::B2<U>::f()
26   C c;
27   c.i = 0;      // { dg-error "context" }
30 int main()
32   A<int>::B2<int> b1;
33   b1.f();       // { dg-error "instantiated" }