================ @@ -7525,25 +7525,21 @@ static Attr *getCCTypeAttr(ASTContext &Ctx, ParsedAttr &Attr) { 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(); + if (DiagnoseUnexpandedParameterPack(CondExpr)) return std::nullopt; - }; - - if (CondExpr->isTypeDependent() || CondExpr->isValueDependent()) { - if (CondExpr->containsUnexpandedParameterPack()) - return BadExpr(); + if (CondExpr->isTypeDependent() || CondExpr->isValueDependent()) return FunctionEffectMode::Dependent; - } std::optional<llvm::APSInt> ConditionValue = CondExpr->getIntegerConstantExpr(Context); - if (!ConditionValue) - return BadExpr(); - return ConditionValue->getExtValue() ? FunctionEffectMode::True - : FunctionEffectMode::False; + if (!ConditionValue) { + Diag(CondExpr->getExprLoc(), diag::err_attribute_argument_type) + << ("'" + AttributeName.str() + "'") << AANT_ArgumentIntegerConstant ---------------- Sirraide wrote:
So yeah, honestly, if it’s already inconsistent, then I’d just pass in the name w/o quotes here and leave fixing that everywhere to a subsequent pr. 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