2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.dg / template / friend.C
blob59564ad94372efaf808ed49db1a3ba12f37b370b
1 // Contribued by Gabriel Dos Reis <gdr@codesourcery.com>
2 // Origin: iskey@i100.ryd.student.liu.se
3 // { dg-do link }
5 #include <iostream>
6 using namespace std;
8 template <class T> struct s;
10 template <class T>
11 ostream& operator<<(ostream &o, const typename s<T>::t &x)
13   return o;
16 template <class T>
17 struct s {
18   struct t
19   {
20     friend ostream&
21     operator<<<T>(ostream&, const typename s<T>::t &);
22   };
23   t x;
26 int main()
28   s<int>::t y;
29   cout << y;