Skip to content

Commit

Permalink
[clang] Fix crash with constexpr destructor
Browse files Browse the repository at this point in the history
  • Loading branch information
hahnjo committed Oct 13, 2023
1 parent 5f56915 commit e29829c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions interpreter/llvm-project/clang/lib/AST/ExprConstant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14932,10 +14932,13 @@ bool Expr::EvaluateAsInitializer(APValue &Value, const ASTContext &Ctx,
LValue LVal;
LVal.set(VD);

if (!EvaluateInPlace(Value, Info, LVal, this,
/*AllowNonLiteralTypes=*/true) ||
EStatus.HasSideEffects)
return false;
{
FullExpressionRAII Scope(Info);
if (!EvaluateInPlace(Value, Info, LVal, this,
/*AllowNonLiteralTypes=*/true) ||
EStatus.HasSideEffects)
return false;
}

// At this point, any lifetime-extended temporaries are completely
// initialized.
Expand Down

0 comments on commit e29829c

Please sign in to comment.