[clang] [clang] Diagnose [[nodiscard]] return types in Objective-C++ (PR #142541)

via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 9 05:19:35 PDT 2025


https://github.com/Sirraide commented:

I would prefer if the code from `CallExpr::getUnusedResultAttr` was factored out into a separate function and reused rather than copy-pasted here since the code is identical save for the class that this is a member of. Specifically, if we make it a function template somewhere (`ASTContext`?) and pass in the `CallExpr`/`ObjCMessageExpr`, we should just be able to reuse it as-is.

https://github.com/llvm/llvm-project/pull/142541


More information about the cfe-commits mailing list