Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / g++.dg / template / memfriend13.C
blob7faed22a2172fbc22d13ef12b11a8cbb2b7bc85c
1 // { dg-do compile }
3 // Copyright (C) 2004 Free Software Foundation
4 // Contributed by Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
6 // Nested class template of class template as friend
8 template <class T> struct A
10   template <class U> struct B
11   {
12     void f();
13   };
16 template <class V> class C {
17   int i;
18   template <class T> template <class U> friend struct A<T>::B;
21 template <class T> struct A<T*>
23   template <class U> struct B
24   {
25     void f();
26   };
29 template <> struct A<char>
31   template <class U> struct B
32   {
33     void f();
34   };
37 template <class T> template <class U> void A<T>::B<U>::f()
39   C<int> c;
40   c.i = 0;
43 template <class T> template <class U> void A<T*>::B<U>::f()
45   C<int> c;
46   c.i = 0;
49 template <class U> void A<char>::B<U>::f()
51   C<int> c;
52   c.i = 0;
55 template <> void A<char>::B<int>::f()
57   C<int> c;
58   c.i = 0;
61 int main()
63   A<int>::B<int> b1;
64   b1.f();
65   A<int *>::B<int> b2;
66   b2.f();
67   A<char>::B<char> b3;
68   b3.f();
69   A<char>::B<int> b4;
70   b4.f();