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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [template/] [access19.C] - Rev 693

Compare with Previous | Blame | View Log

/* 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-error "with U = char, T = int|is private" } */
        T value;
};

int foo( int x, explicit_t< int > y )
{
        return x + y;
}

int main()
{
        return foo( 5, 'c' ); /* { dg-error "this context" } */
}

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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