44// RUN: %clang_cc1 -Weverything -std=c11 -xc -DC11 -verify %s
55// RUN: %clang_cc1 -pedantic -std=c11 -xc -DC11 -verify %s
66// RUN: %clang_cc1 -Weverything -std=c11 -xc -fms-extensions -DMS -verify %s
7+ // RUN: %clang_cc1 -Weverything -std=c2x -xc -DC23 -verify %s
8+ // RUN: %clang_cc1 -pedantic -std=c2x -xc -DC23 -verify %s
9+ // RUN: %clang_cc1 -Weverything -std=c23 -xc -DC23 -verify %s
10+ // RUN: %clang_cc1 -pedantic -std=c23 -xc -DC23 -verify %s
11+ // RUN: %clang_cc1 -Weverything -std=c23 -xc -fms-extensions -DC23 -verify %s
712
813enum X : int {e };
914#if defined(CXX11 )
1015// expected-warning@-2{{enumeration types with a fixed underlying type are incompatible with C++98}}
1116#elif defined(CXX03 )
1217// expected-warning@-4{{enumeration types with a fixed underlying type are a C++11 extension}}
13- #elif defined(OBJC )
18+ #elif defined(OBJC ) || defined( C23 )
1419// No diagnostic
1520#elif defined(C11 )
1621// expected-warning@-8{{enumeration types with a fixed underlying type are a Clang extension}}
@@ -21,19 +26,19 @@ enum X : int {e};
2126// Don't warn about the forward declaration in any language mode.
2227enum Fwd : int ;
2328enum Fwd : int { e2 };
24- #ifndef OBJC
29+ #if !defined( OBJC ) && !defined( C23 )
2530// expected-warning@-3 {{enumeration types with a fixed underlying type}}
2631// expected-warning@-3 {{enumeration types with a fixed underlying type}}
2732#endif
2833
2934// Always error on the incompatible redeclaration.
3035enum BadFwd : int ;
31- #ifndef OBJC
36+ #if !defined( OBJC ) && !defined( C23 )
3237// expected-warning@-2 {{enumeration types with a fixed underlying type}}
3338#endif
3439// expected-note@-4 {{previous declaration is here}}
3540enum BadFwd : char { e3 };
36- #ifndef OBJC
41+ #if !defined( OBJC ) && !defined( C23 )
3742// expected-warning@-2 {{enumeration types with a fixed underlying type}}
3843#endif
3944// expected-error@-4 {{enumeration redeclared with different underlying type 'char' (was 'int')}}
0 commit comments