@@ -16903,24 +16903,19 @@ bool Expr::EvaluateAsConstantExpr(EvalResult &Result, const ASTContext &Ctx,
16903
16903
APValue::LValueBase Base(&BaseMTE);
16904
16904
Info.setEvaluatingDecl(Base, Result.Val);
16905
16905
16906
- if (Info.EnableNewConstInterp) {
16907
- if (!Info.Ctx.getInterpContext().evaluateAsRValue(Info, this, Result.Val))
16908
- return false;
16909
- } else {
16910
- LValue LVal;
16911
- LVal.set(Base);
16912
- // C++23 [intro.execution]/p5
16913
- // A full-expression is [...] a constant-expression
16914
- // So we need to make sure temporary objects are destroyed after having
16915
- // evaluating the expression (per C++23 [class.temporary]/p4).
16916
- FullExpressionRAII Scope(Info);
16917
- if (!::EvaluateInPlace(Result.Val, Info, LVal, this) ||
16918
- Result.HasSideEffects || !Scope.destroy())
16919
- return false;
16906
+ LValue LVal;
16907
+ LVal.set(Base);
16908
+ // C++23 [intro.execution]/p5
16909
+ // A full-expression is [...] a constant-expression
16910
+ // So we need to make sure temporary objects are destroyed after having
16911
+ // evaluating the expression (per C++23 [class.temporary]/p4).
16912
+ FullExpressionRAII Scope(Info);
16913
+ if (!::EvaluateInPlace(Result.Val, Info, LVal, this) ||
16914
+ Result.HasSideEffects || !Scope.destroy())
16915
+ return false;
16920
16916
16921
- if (!Info.discardCleanups())
16922
- llvm_unreachable("Unhandled cleanup; missing full expression marker?");
16923
- }
16917
+ if (!Info.discardCleanups())
16918
+ llvm_unreachable("Unhandled cleanup; missing full expression marker?");
16924
16919
16925
16920
if (!CheckConstantExpression(Info, getExprLoc(), getStorageType(Ctx, this),
16926
16921
Result.Val, Kind))
0 commit comments