On 7/14/25 8:33 PM, Jeremy Rifkin wrote:
Hi Jason,
Thank you so much for taking a look!
This is OK, but I wonder about making do_warn_unused_result ignore empty
types in general; if there's no data in the type, what does it matter if
we ignore the empty box?
I'm not strongly opinionated and I think there are good arguments both
ways. Looking at other implementations, I see clang and msvc both warn
on warn_unused_result/nodiscard for empty types. I think the primary
time this would really matter is generic programming, if I'm working
with `template<T> [[nodiscard]] T foo();` I would probably want a
warning if I discarded the result, even if it's being instantiated
with T = empty type.
Fair enough. Pushed, thanks!
Jason