================ @@ -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( ---------------- Sirraide wrote:
> Not quite sure how to construct a test that won't fail in uninteresting other > ways It’s fine if it does; I just want to make sure we don’t crash on a placeholder expression because that tends to be a recurring problem; the first one you have there is fine imo. For unexpanded packs, I was thinking of something like this ```c++ template <bool ...val> void f() [[clang::nonblocking(val /* NO ... here */)]] {} // error: unexpanded pack ``` which should be ill-formed imo. 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