================ @@ -1616,22 +1616,24 @@ QualType CallExpr::getCallReturnType(const ASTContext &Ctx) const { return FnType->getReturnType(); } -const Attr *CallExpr::getUnusedResultAttr(const ASTContext &Ctx) const { +std::pair<const NamedDecl *, const Attr *> +CallExpr::getUnusedResultAttr(const ASTContext &Ctx) const { + // If the callee is marked nodiscard, return that attribute + const Decl *D = getCalleeDecl(); ---------------- Mick235711 wrote:
Yes, that is definitely observable, as I presented in https://github.com/llvm/llvm-project/pull/112521#issuecomment-2417847257. This actually fixed an inconsistency bug between Clang and GCC/MSVC, with the latter two already always preferring the callee decl. I will add a release note for this. https://github.com/llvm/llvm-project/pull/112521 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits