File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -123,11 +123,12 @@ typedef struct Color NewColor; // expected-error {{use of 'Color' with tag type
123
123
124
124
// Enumerations with a fixed underlying type.
125
125
// https://github.com/llvm/llvm-project/issues/116880
126
- #if __STDC_VERSION__ >= 202311L
126
+ #if __STDC_VERSION__ >= 202311L && !__has_extension (c_fixed_enum )
127
+ #error c_fixed_enum should be set in C23 mode
128
+ #elif __STDC_VERSION__ >= 202311L
127
129
typedef enum : unsigned char { Pink , Black , Cyan } Color ;
128
130
#else
129
- _Static_assert (__has_extension (c_fixed_enum ), "Ensure language extension support for enumerations with a fixed underlying type in <C23" );
130
- typedef enum : unsigned char { Pink , Black , Cyan } Color ; // expected-warning {{enumeration types with a fixed underlying type are a C23 extension}}
131
+ typedef enum : unsigned char { Pink , Black , Cyan } Color ; // pre-c23-warning {{enumeration types with a fixed underlying type are a C23 extension}}
131
132
#endif
132
133
133
134
// PR28903
You can’t perform that action at this time.
0 commit comments