1/* PR c++/29475 The error diagnostic contained "U = U" instead of "U = char" */ 2/* { dg-do compile } */ 3 4template< class T > 5class explicit_t 6{ 7public: 8 explicit_t( const T& c ): value( c ) { } 9 operator T&() { return value; } 10private: 11 template< class U > 12 explicit_t( U t ); /* { dg-error "with U = char, T = int|is private" } */ 13 T value; 14}; 15 16int foo( int x, explicit_t< int > y ) 17{ 18 return x + y; 19} 20 21int main() 22{ 23 return foo( 5, 'c' ); /* { dg-error "this context" } */ 24} 25