Debian Codegraph @

gcc/testsuite/g++.dg/opt/pr18683-1.C

raw
1 // PR middle-end/18683
2 // { dg-do compile }
3 // { dg-options "-O0" }
4
5 template<typename _CharT>
6 struct basic_ostream
7 {
8 basic_ostream& operator<<(int __n);
9 };
10
11 extern basic_ostream<char> cout;
12
13 template<int> struct linear_congruential
14 {
15 template<class CharT>
16 friend basic_ostream<CharT>&
17 operator<<(basic_ostream<CharT>& os,
18 const linear_congruential& lcg)
19 {
20 return os << 1;
21 }
22 };
23
24 void instantiate_all()
25 {
26 linear_congruential<0> lcf;
27 cout << lcf;
28 }
29