aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/enum17.C
blob: 32c46096fff06602262bea30b905947e2b1708c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// PR c++/48536
// { dg-do compile { target c++11 } }

#include <climits>

// According to C++11 / Clause 7.2/5 the following enumeration is
// well-formed.  It is also well-formed in C++03 if UINT_MAX < ULONG_MAX,
// but C++11 adds long long.

enum Enum_Inc  { EI_1=UINT_MAX, EI_2 }; // #1

// It is not equivalent to the following.
enum Enum_Inc2 { FI_1=UINT_MAX, FI_2=FI_1+1 }; // #2

#define SA(X) static_assert(X,#X)
SA (EI_2 != 0);
SA (FI_2 == 0);