================ @@ -19553,17 +19555,18 @@ EnumConstantDecl *Sema::CheckEnumConstant(EnumDecl *Enum, // If we're not in C++, diagnose the overflow of enumerator values, // which in C99 means that the enumerator value is not representable in - // an int (C99 6.7.2.2p2). However, we support GCC's extension that - // permits enumerator values that are representable in some larger - // integral type. - if (!getLangOpts().CPlusPlus && !T.isNull()) + // an int (C99 6.7.2.2p2). However C23 permits enumerator values that + // are representable in some larger integral type and we allow it in + // older language modes as an extension. + if (!getLangOpts().CPlusPlus && !getLangOpts().C23 && !T.isNull()) Diag(IdLoc, diag::warn_enum_value_overflow); ---------------- efriedma-quic wrote:
Should warn_enum_value_overflow also be updated to mention C23? https://github.com/llvm/llvm-project/pull/103917 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits