diff options
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.jason/template24.C')
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.jason/template24.C | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/template24.C b/gcc/testsuite/g++.old-deja/g++.jason/template24.C new file mode 100644 index 000000000..0efce9ff1 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.jason/template24.C @@ -0,0 +1,23 @@ +// { dg-do run } +// Bug: g++ doesn't find the conversion from ostream_withassign to ostream. + +#include <iostream> + +template <class T> +struct A { + T t; +}; + +template <class T> +std::ostream & operator<< (std::ostream & os, A<T> & a) +{ + os << a.t; + return os; +} + +int main () +{ + A<int> a = { 1 }; + std::cout << a << std::endl; +} + |