[clang] [clang] Generate note on declaration for nodiscard-related attributes (PR #112289)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 15 08:16:39 PDT 2024
erichkeane wrote:
> Hmm, I can’t really think of a situation when this note would actually help... at least for `deprecated`, you could _maybe_ argue that you might want to know what part of the codebase marked it as deprecated in case there are multiple declarations, but for `nodiscard`, I don’t think you really care that much, so I feel like this might just be adding noise instead of helping. Imo just the error is enough, but that’s just my opinion.
The one use case I could see is that the `nodiscard` is on the TYPE instead of the function itself (which, as you said before, is goofy for an overload set with this only partially applied). But I don't really see value besides "this should not be discarded", and the actual location of the attribute isn't particularly valuable. What IS important is the 'reason', which we already have.
So this is definitely causing me troubles with 'motivation'.
https://github.com/llvm/llvm-project/pull/112289
More information about the cfe-commits
mailing list