================ @@ -7964,6 +7964,15 @@ TreeTransform<Derived>::TransformIfStmt(IfStmt *S) { // Transform the "then" branch. StmtResult Then; if (!ConstexprConditionValue || *ConstexprConditionValue) { + Sema::ExpressionEvaluationContext Context = + S->isNonNegatedConsteval() + ? Sema::ExpressionEvaluationContext::ImmediateFunctionContext + : Sema::ExpressionEvaluationContext::PotentiallyEvaluated; + + EnterExpressionEvaluationContext Ctx( + getSema(), Context, nullptr, + Sema::ExpressionEvaluationContextRecord::EK_Other); ---------------- cor3ntin wrote:
You are right, it's nicer this way, thanks. https://github.com/llvm/llvm-project/pull/91939 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits