Testcase from PR #3351
authorgdr <gdr@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 12 Aug 2001 08:15:30 +0000 (08:15 +0000)
committergdr <gdr@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 12 Aug 2001 08:15:30 +0000 (08:15 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@44821 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/g++.dg/template/friend.C [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.dg/template/friend.C b/gcc/testsuite/g++.dg/template/friend.C
new file mode 100644 (file)
index 0000000..59564ad
--- /dev/null
@@ -0,0 +1,30 @@
+// Contribued by Gabriel Dos Reis <gdr@codesourcery.com>
+// Origin: iskey@i100.ryd.student.liu.se
+// { dg-do link }
+
+#include <iostream>
+using namespace std;
+
+template <class T> struct s;
+
+template <class T>
+ostream& operator<<(ostream &o, const typename s<T>::t &x)
+{
+  return o;
+}
+
+template <class T>
+struct s {
+  struct t
+  {
+    friend ostream&
+    operator<<<T>(ostream&, const typename s<T>::t &);
+  };
+  t x;
+};
+
+int main()
+{
+  s<int>::t y;
+  cout << y;
+}