https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101682
Paul Eggert <eggert at gnu dot org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID --- Comment #5 from Paul Eggert <eggert at gnu dot org> --- Thanks for the clarification, Joseph. I'll fix Gnulib accordingly. Marking the bug as RESOLVED INVALID. FWIW the comment 2 code works even with bleeding-edge clang because __has_c_attribute (nodiscard) is still 0 in there. PS. It is a bit annoying that one can't do this: int f (int) [[nodiscard]]; as that would match the existing Gnulib style of putting attributes at the end of the function declarations. I don't know whether such a thing could be added as a GCC extension, but I suppose it's not worth the trouble since it wouldn't be portable as per draft C2x.