Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / g++.old-deja / g++.pt / friend44.C
blob1d2c1d1f9b67b06ed314ac6b2c320d86847f51dd
1 // { dg-do compile }
2 // Test that template friends referring to class template members are
3 // respected.
6 template <class T> struct A
8   int f (T);
9   struct AI {
10     int f (T);
11   };
14 class B
16   template <class T> friend int A<T>::f (T);
17   template <class T> friend struct A<T>::AI;
18   int a;
19 public:
20   B(): a(0) { }
23 template <class T> int A<T>::f (T)
25   B b;
26   return b.a;
29 template <class T> int A<T>::AI::f (T)
31   B b;
32   return b.a;
35 int main ()
37   A<int> a;
38   A<int>::AI ai;
40   int r = a.f (0);
41   r |= ai.f (0);
43   return r;