URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Subversion Repositories openrisc_me
[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.dg/] [tc1/] [dr128.C] - Rev 308
Go to most recent revision | Compare with Previous | Blame | View Log
// { dg-do run }
// Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
// DR128: Casting between enum types
extern "C" void abort(void);
enum E1 { BLACK = 0, RED = 1 };
enum E2 { WHITE = 0, YELLOW = 1};
int main(void)
{
E1 e1 = RED;
E2 e2 = static_cast<E2>(e1);
if (e2 != YELLOW)
abort();
return 0;
}
Go to most recent revision | Compare with Previous | Blame | View Log