================ @@ -302,27 +312,38 @@ void Sema::DiagnoseUnusedExprResult(const Stmt *S, unsigned DiagID) { if (const Decl *FD = CE->getCalleeDecl()) { if (ShouldSuppress) return; - if (FD->hasAttr<PureAttr>()) { + if (const auto *A = FD->getAttr<PureAttr>()) { Diag(Loc, diag::warn_unused_call) << R1 << R2 << "pure"; + if (OffendingDecl && !OffendingDecl->getIdentifier()->getBuiltinID()) ---------------- erichkeane wrote:
it won't be the 1st line IIRC, the built in location should have the location <builtin>, which makes sense. I think this test is still sensible though. https://github.com/llvm/llvm-project/pull/112289 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits