================ @@ -7963,6 +7967,148 @@ static Attr *getCCTypeAttr(ASTContext &Ctx, ParsedAttr &Attr) { llvm_unreachable("unexpected attribute kind!"); } +ExprResult Sema::ActOnEffectExpression(Expr *CondExpr, FunctionEffectMode &Mode, + bool RequireConstexpr) { + // see checkFunctionConditionAttr, Sema::CheckCXXBooleanCondition + if (RequireConstexpr || !CondExpr->isTypeDependent()) { + ExprResult E = PerformContextuallyConvertToBool(CondExpr); + if (E.isInvalid()) + return E; + CondExpr = E.get(); + if (RequireConstexpr || !CondExpr->isValueDependent()) { + llvm::APSInt CondInt; + E = VerifyIntegerConstantExpression( ---------------- dougsonos wrote:
`Sema::ActOnEffectExpression()` is now much simpler -- it checks for dependence and unexpanded parameter packs before trying to evaluate the expression as an integer constant. https://github.com/llvm/llvm-project/pull/84983 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits