Debian Codegraph @

gcc/testsuite/g++.old-deja/g++.pt/friend12.C

raw
1 // { dg-do run }
2 template <class T>
3 class C;
4
5 template <class T>
6 struct S
7 {
8 template <class U>
9 void f(U u1, U u2) {}
10
11 template <class U>
12 void f(U u)
13 {
14 C<T> ct;
15 ct.i = 3;
16 }
17 };
18
19
20 template <class T>
21 class C
22 {
23 template <class U>
24 friend void S<T>::f(U);
25
26 int i;
27 };
28
29
30 int main()
31 {
32 S<int> si;
33 si.f(3.0);
34 }