================ @@ -2203,8 +2203,18 @@ Parser::ParseCXXCondition(StmtResult *InitStmt, SourceLocation Loc, return ParseCXXCondition(nullptr, Loc, CK, MissingOK); } - // Parse the expression. - ExprResult Expr = ParseExpression(); // expression + ExprResult Expr; + { + EnterExpressionEvaluationContext Eval( + Actions, Sema::ExpressionEvaluationContext::ConstantEvaluated, + /*LambdaContextDecl=*/nullptr, + /*ExprContext=*/Sema::ExpressionEvaluationContextRecord::EK_Other, + /*ShouldEnter=*/CK == Sema::ConditionKind::ConstexprIf); + + // Parse the expression. + Expr = ParseExpression(); // expression + } ---------------- a-tarasyuk wrote:
@zyn0217 Thanks for the suggestion. I've added changes. https://github.com/llvm/llvm-project/pull/123667 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits