================
@@ -9749,6 +9749,11 @@ bool LValueExprEvaluator::VisitArraySubscriptExpr(const
ArraySubscriptExpr *E) {
if (Success) {
Result.setFrom(Info.Ctx, Val);
+ // If Index cannot be represented as a 64 bit integer, return
+ // unsuccessful.
+ if (!Index.tryExtValue().has_value())
----------------
Fznamznon wrote:
So, with this change we exit constexpr evaluation with some kind of error. I
see that `Error` function is actually intended to emit notes additionally to a
some error which according to the test we don't emit, so if we don't want to
emit messages for the case I don't think using Error is right here.
Does CodeGen produce a correct result for the code? In case it is not, the fix
is actually broader, so I'd also suggest a test checking LLVM IR emitted.
https://github.com/llvm/llvm-project/pull/172399
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits