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
PR c++/81917 - ICE with void_t and partial specialization.
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
opt
/
enum2.C
blob
40a496e535dc06f53aaf5a3dac89cbbb27f1cb73
1
// PR c++/43680
2
// Test that we don't make excessively aggressive assumptions about what
3
// values an enum variable can have.
4
// { dg-do run { target fpic } }
5
// { dg-options "-O2 -fPIC" }
6
7
extern "C" void abort ();
8
9
enum E { A, B, C, D };
10
11
void
12
CheckE(const E value)
13
{
14
long v = value;
15
if (v <= D)
16
abort ();
17
}
18
19
int main() {
20
CheckE(static_cast<E>(5));
21
}