gcc/testsuite/g++.dg/cpp0x/enum17.C
raw| 1 | // PR c++/48536 |
| 2 | // { dg-do compile { target c++11 } } |
| 3 | |
| 4 | #include <climits> |
| 5 | |
| 6 | // According to C++11 / Clause 7.2/5 the following enumeration is |
| 7 | // well-formed. It is also well-formed in C++03 if UINT_MAX < ULONG_MAX, |
| 8 | // but C++11 adds long long. |
| 9 | |
| 10 | enum Enum_Inc { EI_1=UINT_MAX, EI_2 }; // #1 |
| 11 | |
| 12 | // It is not equivalent to the following. |
| 13 | enum Enum_Inc2 { FI_1=UINT_MAX, FI_2=FI_1+1 }; // #2 |
| 14 | |
| 15 | #define SA(X) static_assert(X,#X) |
| 16 | SA (EI_2 != 0); |
| 17 | SA (FI_2 == 0); |