diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/opt/pr18683-1.C')
-rw-r--r-- | gcc/testsuite/g++.dg/opt/pr18683-1.C | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/opt/pr18683-1.C b/gcc/testsuite/g++.dg/opt/pr18683-1.C new file mode 100644 index 000000000..847a4d3c6 --- /dev/null +++ b/gcc/testsuite/g++.dg/opt/pr18683-1.C @@ -0,0 +1,29 @@ +// PR middle-end/18683 +// { dg-do compile } +// { dg-options "-O0" } + +template<typename _CharT> +struct basic_ostream +{ + basic_ostream& operator<<(int __n); +}; + +extern basic_ostream<char> cout; + +template<int> struct linear_congruential +{ + template<class CharT> + friend basic_ostream<CharT>& + operator<<(basic_ostream<CharT>& os, + const linear_congruential& lcg) + { + return os << 1; + } +}; + +void instantiate_all() +{ + linear_congruential<0> lcf; + cout << lcf; +} + |