================ @@ -627,7 +627,7 @@ class Analyzer { IsNoexcept = isNoexcept(FD); } else if (auto *BD = dyn_cast<BlockDecl>(D)) { if (auto *TSI = BD->getSignatureAsWritten()) { - auto *FPT = TSI->getType()->getAs<FunctionProtoType>(); + auto *FPT = TSI->getType()->castAs<FunctionProtoType>(); ---------------- AaronBallman wrote:
This code path is hit from: ``` if (Context.hasAnyFunctionEffects()) performFunctionEffectAnalysis(Context.getTranslationUnitDecl()); ``` and the only thing that sets `AnyFunctionEffects` is through a call to `ASTContext::getFunctionTypeInternal()`, which is only called for functions with prototypes. So I believe this change is correct as-is, but is a bit fragile. CC @Sirraide @cjappl @dougsonos for extra eyes; are K&R C functions supposed to support function effects? If so, I suspect that doesn't work today. https://github.com/llvm/llvm-project/pull/117176 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits