Debian Codegraph @

gcc/testsuite/g++.dg/template/friend14.C

raw
1 // { dg-do compile }
2
3 // Origin: Wolfgang Bangerth <[email protected]>
4
5 // Perform access checking to parameter and return type of
6 // function template correctly when the template is friend.
7
8 template <class T> class O {
9 struct I { I (int); };
10
11 template <class T_>
12 friend typename O<T_>::I f ();
13 };
14
15 template <class T_>
16 typename O<T_>::I f () { return 1; }
17
18 struct X {
19 void g() { f<int>(); }
20 };