================
@@ -20822,10 +20822,12 @@ void Sema::ActOnEnumBody(SourceLocation EnumLoc,
SourceRange BraceRange,
NewSign = true;
} else if (ECD->getType() == BestType) {
// Already the right type!
- if (getLangOpts().CPlusPlus)
+ if (getLangOpts().CPlusPlus || (getLangOpts().C23 && Enum->isFixed()))
// C++ [dcl.enum]p4: Following the closing brace of an
// enum-specifier, each enumerator has the type of its
// enumeration.
+ // C23 6.7.2.2p15: For an enumerated type with fixed underlying type,
+ // the enumeration member type is the enumerated type.
----------------
AaronBallman wrote:
```suggestion
// C23 6.7.3.3p16: The enumeration member type for an enumerated type
with fixed
// underlying type is the enumerated type.
```
https://github.com/llvm/llvm-project/pull/172211
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits