================ @@ -7518,6 +7523,154 @@ static Attr *getCCTypeAttr(ASTContext &Ctx, ParsedAttr &Attr) { llvm_unreachable("unexpected attribute kind!"); } +std::optional<FunctionEffectMode> +Sema::ActOnEffectExpression(Expr *CondExpr, StringRef AttributeName) { + auto BadExpr = [&]() { + Diag(CondExpr->getExprLoc(), diag::err_attribute_argument_type) + << ("'" + AttributeName.str() + "'") << AANT_ArgumentIntegerConstant + << CondExpr->getSourceRange(); + return std::nullopt; + }; + + if (CondExpr->isTypeDependent() || CondExpr->isValueDependent()) { + if (CondExpr->containsUnexpandedParameterPack()) + return BadExpr(); + return FunctionEffectMode::Dependent; + } ---------------- Sirraide wrote:
One more thing: checking for unexpanded packs in expression arguments of attributes in general seems to be a bit broken at the moment, and we might end up moving that check somewhere else; I’d keep it here for the time being and we’ll either remove it after this gets merged or I’ll try to remember to let you know if this should be removed again. 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