OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.dg/] [template/] [access19.C] - Diff between revs 154 and 816

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" } */
}
}
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.