view gcc/testsuite/g++.dg/opt/pr18683-1.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 04ced10e8804
children
line wrap: on
line source

// 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;
}