repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
template
/
friend.C
blob
59564ad94372efaf808ed49db1a3ba12f37b370b
1
// Contribued by Gabriel Dos Reis <gdr@codesourcery.com>
2
// Origin: iskey@i100.ryd.student.liu.se
3
// { dg-do link }
4
5
#include <iostream>
6
using namespace std;
7
8
template <class T> struct s;
9
10
template <class T>
11
ostream& operator<<(ostream &o, const typename s<T>::t &x)
12
{
13
return o;
14
}
15
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;
24
};
25
26
int main()
27
{
28
s<int>::t y;
29
cout << y;
30
}