OSDN Git Service

cp:
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.old-deja / g++.pt / friend12.C
1 template <class T>
2 class C;
3
4 template <class T>
5 struct S
6 {
7   template <class U>
8   void f(U u1, U u2) {}
9
10   template <class U>
11   void f(U u)
12     {
13       C<T> ct;
14       ct.i = 3;
15     }
16 };
17
18
19 template <class T>
20 class C
21 {
22   template <class U>
23   friend void S<T>::f(U);
24
25   int i;
26 };
27
28
29 int main()
30 {
31   S<int> si;
32   si.f(3.0);
33 }