PR c++/81917 - ICE with void_t and partial specialization.
[official-gcc.git] / gcc / testsuite / g++.dg / opt / enum2.C
blob40a496e535dc06f53aaf5a3dac89cbbb27f1cb73
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" }
7 extern "C" void abort ();
9 enum E { A, B, C, D };
11 void
12 CheckE(const E value)
14   long v = value;
15   if (v <= D)
16     abort ();
19 int main() {
20   CheckE(static_cast<E>(5));