[clang] [clang][C23] Support N3029 Improved Normal Enumerations (PR #103917)

Mariya Podchishchaeva via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 2 05:48:38 PDT 2024


================
@@ -19474,11 +19474,12 @@ EnumConstantDecl *Sema::CheckEnumConstant(EnumDecl *Enum,
           //   representable as an int.
 
           // Complain if the value is not representable in an int.
-          if (!isRepresentableIntegerValue(Context, EnumVal, Context.IntTy))
-            Diag(IdLoc, diag::ext_enum_value_not_int)
-              << toString(EnumVal, 10) << Val->getSourceRange()
-              << (EnumVal.isUnsigned() || EnumVal.isNonNegative());
-          else if (!Context.hasSameType(Val->getType(), Context.IntTy)) {
+          if (!isRepresentableIntegerValue(Context, EnumVal, Context.IntTy)) {
+            if (!getLangOpts().C23)
+              Diag(IdLoc, diag::ext_enum_value_not_int)
----------------
Fznamznon wrote:

Added.

https://github.com/llvm/llvm-project/pull/103917


More information about the cfe-commits mailing list