diff --git a/contrib/llvm-project/clang/include/clang/Basic/DiagnosticASTKinds.td b/contrib/llvm-project/clang/include/clang/Basic/DiagnosticASTKinds.td index 28120d13fd9e..4e2e0bd3079c 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/DiagnosticASTKinds.td +++ b/contrib/llvm-project/clang/include/clang/Basic/DiagnosticASTKinds.td @@ -393,8 +393,8 @@ def warn_fixedpoint_constant_overflow : Warning< "overflow in expression; result is %0 with type %1">, InGroup>; def warn_constexpr_unscoped_enum_out_of_range : Warning< - "integer value %0 is outside the valid range of values [%1, %2] for this " - "enumeration type">, DefaultError, InGroup>; + "integer value %0 is outside the valid range of values [%1, %2] for the " + "enumeration type %3">, DefaultError, InGroup>; // This is a temporary diagnostic, and shall be removed once our // implementation is complete, and like the preceding constexpr notes belongs diff --git a/contrib/llvm-project/clang/lib/AST/ExprConstant.cpp b/contrib/llvm-project/clang/lib/AST/ExprConstant.cpp index 464104139cb2..db6c07d4ab7f 100644 --- a/contrib/llvm-project/clang/lib/AST/ExprConstant.cpp +++ b/contrib/llvm-project/clang/lib/AST/ExprConstant.cpp @@ -13682,12 +13682,13 @@ bool IntExprEvaluator::VisitCastExpr(const CastExpr *E) { Info.Ctx.getDiagnostics().Report( E->getExprLoc(), diag::warn_constexpr_unscoped_enum_out_of_range) << llvm::toString(Result.getInt(), 10) << Min.getSExtValue() - << Max.getSExtValue(); + << Max.getSExtValue() << ED; else if (!ED->getNumNegativeBits() && ConstexprVar && Max.ult(Result.getInt().getZExtValue())) - Info.Ctx.getDiagnostics().Report(E->getExprLoc(), - diag::warn_constexpr_unscoped_enum_out_of_range) - << llvm::toString(Result.getInt(),10) << Min.getZExtValue() << Max.getZExtValue(); + Info.Ctx.getDiagnostics().Report( + E->getExprLoc(), diag::warn_constexpr_unscoped_enum_out_of_range) + << llvm::toString(Result.getInt(), 10) << Min.getZExtValue() + << Max.getZExtValue() << ED; } }