From: Gabriel Dos Reis Date: Sun, 12 Aug 2001 08:15:30 +0000 (+0000) Subject: Testcase from PR #3351 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e7e0c3d41205edf1e5a0595bfc8d53f77a2df222;p=gcc.git Testcase from PR #3351 From-SVN: r44821 --- diff --git a/gcc/testsuite/g++.dg/template/friend.C b/gcc/testsuite/g++.dg/template/friend.C new file mode 100644 index 00000000000..59564ad9437 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/friend.C @@ -0,0 +1,30 @@ +// Contribued by Gabriel Dos Reis +// Origin: iskey@i100.ryd.student.liu.se +// { dg-do link } + +#include +using namespace std; + +template struct s; + +template +ostream& operator<<(ostream &o, const typename s::t &x) +{ + return o; +} + +template +struct s { + struct t + { + friend ostream& + operator<<(ostream&, const typename s::t &); + }; + t x; +}; + +int main() +{ + s::t y; + cout << y; +}