URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 154 |
Rev 816 |
/* PR c++/29475 The error diagnostic contained "U = U" instead of "U = char" */
|
/* PR c++/29475 The error diagnostic contained "U = U" instead of "U = char" */
|
/* { dg-do "compile" } */
|
/* { dg-do "compile" } */
|
|
|
template< class T >
|
template< class T >
|
class explicit_t
|
class explicit_t
|
{
|
{
|
public:
|
public:
|
explicit_t( const T& c ): value( c ) { }
|
explicit_t( const T& c ): value( c ) { }
|
operator T&() { return value; }
|
operator T&() { return value; }
|
private:
|
private:
|
template< class U >
|
template< class U >
|
explicit_t( U t ); /* { dg-error "with U = char, T = int|is private" } */
|
explicit_t( U t ); /* { dg-error "with U = char, T = int|is private" } */
|
T value;
|
T value;
|
};
|
};
|
|
|
int foo( int x, explicit_t< int > y )
|
int foo( int x, explicit_t< int > y )
|
{
|
{
|
return x + y;
|
return x + y;
|
}
|
}
|
|
|
int main()
|
int main()
|
{
|
{
|
return foo( 5, 'c' ); /* { dg-error "this context" } */
|
return foo( 5, 'c' ); /* { dg-error "this context" } */
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.