-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[clang][NFC] Clean up Expr::EvaluateAsConstantExpr #130498
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The Info.EnableNewConstInterp case is already handled above.
@llvm/pr-subscribers-clang Author: Timm Baeder (tbaederr) ChangesThe Info.EnableNewConstInterp case is already handled above. Full diff: https://github.com/llvm/llvm-project/pull/130498.diff 1 Files Affected:
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp
index d9a1e5bb42343..759df64da6215 100644
--- a/clang/lib/AST/ExprConstant.cpp
+++ b/clang/lib/AST/ExprConstant.cpp
@@ -16892,24 +16892,19 @@ bool Expr::EvaluateAsConstantExpr(EvalResult &Result, const ASTContext &Ctx,
APValue::LValueBase Base(&BaseMTE);
Info.setEvaluatingDecl(Base, Result.Val);
- if (Info.EnableNewConstInterp) {
- if (!Info.Ctx.getInterpContext().evaluateAsRValue(Info, this, Result.Val))
- return false;
- } else {
- LValue LVal;
- LVal.set(Base);
- // C++23 [intro.execution]/p5
- // A full-expression is [...] a constant-expression
- // So we need to make sure temporary objects are destroyed after having
- // evaluating the expression (per C++23 [class.temporary]/p4).
- FullExpressionRAII Scope(Info);
- if (!::EvaluateInPlace(Result.Val, Info, LVal, this) ||
- Result.HasSideEffects || !Scope.destroy())
- return false;
+ LValue LVal;
+ LVal.set(Base);
+ // C++23 [intro.execution]/p5
+ // A full-expression is [...] a constant-expression
+ // So we need to make sure temporary objects are destroyed after having
+ // evaluating the expression (per C++23 [class.temporary]/p4).
+ FullExpressionRAII Scope(Info);
+ if (!::EvaluateInPlace(Result.Val, Info, LVal, this) ||
+ Result.HasSideEffects || !Scope.destroy())
+ return false;
- if (!Info.discardCleanups())
- llvm_unreachable("Unhandled cleanup; missing full expression marker?");
- }
+ if (!Info.discardCleanups())
+ llvm_unreachable("Unhandled cleanup; missing full expression marker?");
if (!CheckConstantExpression(Info, getExprLoc(), getStorageType(Ctx, this),
Result.Val, Kind))
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/81/builds/5064 Here is the relevant piece of the build log for the reference
|
The Info.EnableNewConstInterp case is already handled above.