================ @@ -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:
This situation of an offending decl not being always present is, imo, not really something we should be ok with. As far as skipping on builtins, I don't know if we SHOULD, I would think the note there is still meaningful. 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