1// PR middle-end/18683
2// { dg-do compile }
3// { dg-options "-O0" }
4
5template<typename _CharT>
6struct basic_ostream
7{
8  basic_ostream& operator<<(int __n);
9};
10
11extern basic_ostream<char>  cout;
12
13template<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
24void instantiate_all()
25{
26  linear_congruential<0> lcf;
27  cout << lcf;
28}
29
30