1 /* Test C2x enumerations with values not representable in int. Test
2 -Wc11-c2x-compat warnings. */
3 /* { dg-do compile } */
4 /* { dg-options "-std=c2x -pedantic-errors -Wc11-c2x-compat" } */
5
6 enum e1 { e1a = -__LONG_LONG_MAX__ - 1 }; /* { dg-warning "ISO C restricts enumerator values" } */
7
8 enum e2 { e2a = __LONG_LONG_MAX__ }; /* { dg-warning "ISO C restricts enumerator values" } */
9
10 enum e3 { e3a = (unsigned int) -1 }; /* { dg-warning "ISO C restricts enumerator values" } */
11
12 enum e4 { e4a = (long long) -__INT_MAX__ - 1, e4b = (unsigned int) __INT_MAX__ };