diff options
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/opt/pr18683-1.C | 29 |
2 files changed, 34 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d05d4ef..138785b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2004-12-20 Roger Sayle <roger@eyesopen.com> + + PR middle-end/18683 + * g++.dg/opt/pr18683-1.C: New test case. + 2004-12-20 Andrew Pinski <pinskia@physics.uc.edu> PR other/19093 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 0000000..847a4d3 --- /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; +} + |