cp/
[official-gcc.git] / gcc / testsuite / g++.dg / template / friend.C
blob5e9abb0b52a051e50e45225b0037d13ed9eaa431
1 // Contribued by Gabriel Dos Reis <gdr@codesourcery.com>
2 // Origin: iskey@i100.ryd.student.liu.se
4 class ostream;
5 extern ostream& cout;
7 template <class T> struct s;
9 template <class T>
10 ostream& operator<<(ostream &o, const typename s<T>::t &x)
12   return o;
15 template <class T>
16 struct s {
17   struct t
18   {
19     friend ostream&
20     operator<<<T>(ostream&, const typename s<T>::t &);
21   };
22   t x;
25 int main()
27   s<int>::t y;
28   cout << y; // { dg-error "" }