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/] [warn/] [Wswitch-3.C] - Rev 318
Go to most recent revision | Compare with Previous | Blame | View Log
/* { dg-do compile } */
/* { dg-options "-Wswitch" } */
enum E { A, B, C, D, E, F };
int
f1 (enum E e)
{
switch (e)
{
case A: return 1;
case B: return 2;
case C: return 3;
case D: return 4;
case E: return 5;
case F: return 6;
case 7: return 7; /* { dg-warning "not in enumerated type" } */
}
return 0;
}
int
f2 (enum E e)
{
switch (e)
{
case A: return 1;
case B: return 2;
case C: return 3;
case D: return 4;
case E: return 5;
case F: return 6;
case 7: return 7; /* { dg-warning "not in enumerated type" } */
default: return 8;
}
return 0;
}
Go to most recent revision | Compare with Previous | Blame | View Log