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