gcc/testsuite/gcc.dg/gnu23-enum-1.c
raw| 1 | /* Test C23 enumerations with fixed underlying type together with GNU |
| 2 | extensions: an enum cannot be forward declared without a fixed underlying |
| 3 | type and then declared or defined with one. */ |
| 4 | /* { dg-do compile } */ |
| 5 | /* { dg-options "-std=gnu23" } */ |
| 6 | |
| 7 | enum e1; |
| 8 | enum e1 : int; /* { dg-error "'enum' declared both with and without fixed underlying type" } */ |
| 9 | |
| 10 | enum e2; |
| 11 | enum e2 : long { A }; /* { dg-error "'enum' declared both with and without fixed underlying type" } */ |