================ @@ -19807,20 +19807,46 @@ EnumConstantDecl *Sema::CheckEnumConstant(EnumDecl *Enum, // sufficient to contain the incremented value. If no such type // exists, the program is ill-formed. QualType T = getNextLargerIntegralType(Context, EltTy); - if (T.isNull() || Enum->isFixed()) { + if (Enum->isFixed()) { // There is no integral type larger enough to represent this // value. Complain, then allow the value to wrap around. EnumVal = LastEnumConst->getInitVal(); EnumVal = EnumVal.zext(EnumVal.getBitWidth() * 2); ++EnumVal; - if (Enum->isFixed()) - // When the underlying type is fixed, this is ill-formed. - Diag(IdLoc, diag::err_enumerator_wrapped) - << toString(EnumVal, 10) - << EltTy; - else + // When the underlying type is fixed, this is ill-formed. + Diag(IdLoc, diag::err_enumerator_wrapped) + << toString(EnumVal, 10) << EltTy; + + } else if (T.isNull()) { + if (EltTy->isSignedIntegerType() && + (getLangOpts().CPlusPlus || + LangStandard::getLangStandardForKind(getLangOpts().LangStd) + .isC23())) { ---------------- wheatman wrote:
Thanks you, I did see that in my looking https://github.com/llvm/llvm-project/pull/78742 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits