diff options
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.jason/tempinst1.C')
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.jason/tempinst1.C | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/tempinst1.C b/gcc/testsuite/g++.old-deja/g++.jason/tempinst1.C new file mode 100644 index 000000000..966256f37 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.jason/tempinst1.C @@ -0,0 +1,23 @@ +// { dg-do link } +// { dg-options "-g" } +// Bug: g++ fails to instantiate operator<<. + +struct ostream { + ostream& operator<< (const char *) { return *this; }; +}; + +template <class T> class foo; + +template <class T> ostream& operator<< (ostream& ios, foo<T>&obj) {return ios;} + +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; +} |