summaryrefslogtreecommitdiff
path: root/gcc_arm/testsuite/g++.old-deja/g++.jason/tempinst1.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc_arm/testsuite/g++.old-deja/g++.jason/tempinst1.C')
-rwxr-xr-xgcc_arm/testsuite/g++.old-deja/g++.jason/tempinst1.C23
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc_arm/testsuite/g++.old-deja/g++.jason/tempinst1.C b/gcc_arm/testsuite/g++.old-deja/g++.jason/tempinst1.C
new file mode 100755
index 0000000..0a8a6cc
--- /dev/null
+++ b/gcc_arm/testsuite/g++.old-deja/g++.jason/tempinst1.C
@@ -0,0 +1,23 @@
+// Bug: g++ fails to instantiate operator<<.
+// Build don't run:
+// Special g++ Options: -g
+
+struct ostream {
+ ostream& operator<< (const char *) { return *this; };
+};
+
+template <class T> class foo;
+
+template <class T> ostream& operator<< (ostream& ios, foo<T>&obj) { };
+
+template <class T> class foo {
+ friend ostream& operator<<<>(ostream&, foo<T>&);
+};
+
+int main()
+{
+ ostream cout;
+ foo<int> foo_obj;
+ cout << foo_obj; // causes linker error
+ return 0;
+}