================ @@ -1048,15 +1048,14 @@ class Analyzer { } void checkIndirectCall(CallExpr *Call, QualType CalleeType) { - auto *FPT = - CalleeType->getAs<FunctionProtoType>(); // Null if FunctionType. FunctionEffectKindSet CalleeEffects; - if (FPT) - CalleeEffects.insert(FPT->getFunctionEffects()); + if (FunctionEffectsRef Effects = FunctionEffectsRef::get(CalleeType); + !Effects.empty()) + CalleeEffects.insert(Effects); auto Check1Effect = [&](FunctionEffect Effect, bool Inferring) { - if (FPT == nullptr || Effect.shouldDiagnoseFunctionCall( - /*direct=*/false, CalleeEffects)) + if (Effect.shouldDiagnoseFunctionCall( ---------------- dougsonos wrote:
The check for a null FPT is/was superfluous; in that case the callee never has any declared effects and `shouldDiagnoseFunctionCall` will complain. https://github.com/llvm/llvm-project/pull/111224 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits