[PATCH] D148505: Allow `__attribute__((warn_unused))` on individual constructors

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 19 09:51:12 PDT 2023


aaron.ballman added a comment.

In D148505#4331647 <https://reviews.llvm.org/D148505#4331647>, @sberg wrote:

> In D148505#4302702 <https://reviews.llvm.org/D148505#4302702>, @aaron.ballman wrote:
>
>> Thank you for poking on this! FWIW, I don't know that there's a way to cross-post to Discourse (but if I'm wrong and there is, I'd love to know how!).
>
> Ping, any further input from anybody?
>
> (The cross-posting didn't work, but there was also almost no response on the GCC side, https://gcc.gnu.org/pipermail/gcc/2023-April/241220.html "Re: GCC/Clang attributes guiding warnings about unused entities".)

I've thought about it a bit since the last time around, and I'm still kind of uncomfortable with the changes especially given that GCC folks don't seem to have an appetite to change the behavior. However, I'm also not firmly opposed to the idea either as there is some nice symmetry. Most of my concerns really boil down to the ergonomics of how all the various attributes in this space are slightly different from one another; unless GCC goes the same direction, this is one more difference between the attributes that you need to worry about. However, at least GCC warns that they're ignoring the attribute when written on a constructor: https://godbolt.org/z/bzTojhs1f so perhaps this difference is reasonable so long as we have some amazing documentation.

I'm not certain if @erichkeane has new thoughts or not.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D148505/new/

https://reviews.llvm.org/D148505



More information about the cfe-commits mailing list