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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [enum_base_warn.C] - Blame information for rev 774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// { dg-do run }
2
// { dg-options "-O2 -Wtype-limits -std=c++0x" }
3
extern void link_error (void);
4
 
5
enum Alpha : unsigned char {
6
 ZERO = 0, ONE, TWO, THREE
7
};
8
 
9
Alpha a2;
10
 
11
int m1 = -1;
12
int GetM1() {
13
 return m1;
14
}
15
 
16
int main() {
17
 a2 = static_cast(GetM1());
18
 if (a2 == -1) {        // { dg-warning "always false due" }
19
    link_error ();
20
 }
21
 if (-1 == a2) {        // { dg-warning "always false due" }
22
    link_error ();
23
 }
24
 return 0;
25
}

powered by: WebSVN 2.1.0

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