1// { dg-do assemble } 2// Bug: member operator shadows global template in tsubst. 3 4class ostream; 5 6template <class TP> class smanip; 7 8template<class TP> 9ostream& operator<<(ostream& o, const smanip<TP>& m); 10 11template <class TP> class smanip { 12public: 13 friend ostream& operator<< <>(ostream &o, const smanip<TP>&m); 14}; 15 16template<class TP> 17ostream& operator<<(ostream& o, const smanip<TP>& m) 18{ return o;} 19 20class X 21{ 22public: 23 X operator<<(int); // commenting out this line makes it work! 24 void print(ostream& os); 25}; 26 27void X::print(ostream& os) 28{ 29 smanip<double> smd; 30 os << smd; // { dg-bogus "" } 31} 32