Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/g++.dg/template/access19.C @ 152:2b5abeee2509
update gcc11
author | anatofuz |
---|---|
date | Mon, 25 May 2020 07:50:57 +0900 |
parents | 04ced10e8804 |
children |
line wrap: on
line source
/* PR c++/29475 The error diagnostic contained "U = U" instead of "U = char" */ /* { dg-do compile } */ template< class T > class explicit_t { public: explicit_t( const T& c ): value( c ) { } operator T&() { return value; } private: template< class U > explicit_t( U t ); /* { dg-message "with U = char, T = int|private" } */ T value; }; int foo( int x, explicit_t< int > y ) { return x + y; } int main() { return foo( 5, 'c' ); /* { dg-error "this context" } */ }