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/] [pr33738.C] - Rev 307
Go to most recent revision | Compare with Previous | Blame | View Log
// { dg-do run }
// { dg-options "-O2 -Wtype-limits" }
extern void link_error (void);
enum Alpha {
ZERO = 0, ONE, TWO, THREE
};
Alpha a2;
int m1 = -1;
int GetM1() {
return m1;
}
int main() {
a2 = static_cast<Alpha>(GetM1());
if (a2 == -1) { // { dg-warning "always false due" }
link_error ();
}
if (-1 == a2) { // { dg-warning "always false due" }
link_error ();
}
return 0;
}
Go to most recent revision | Compare with Previous | Blame | View Log