repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Reset branch to trunk.
[official-gcc.git]
/
trunk
/
gcc
/
testsuite
/
g++.dg
/
warn
/
pr33738.C
blob
8847b6e342cd6449ffef548bcb2e5e454412c5d6
1
// { dg-do run }
2
// { dg-options "-O2 -Wtype-limits" }
3
extern void link_error (void);
4
5
enum Alpha {
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<Alpha>(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
}
26