[Bug c++/104494] -Wsuggest-attribute=noreturn catch 22

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Feb 11 09:16:05 GMT 2022


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104494

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hubicka at gcc dot gnu.org
           Keywords|                            |diagnostic

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
I think the attribute suggestion happens with some IPA analysis which
figures the lambda is after inlining the lambda but the diagnostic about
a noreturn function returning happens before.

That would mean the attribute suggestion should be based on local analysis
only, not using IPA discovered noreturn.

Not sure how that's easily possible.  We don't suggest noreturn for the
lambda because the C++ FE says it's OK to miss it there.


More information about the Gcc-bugs mailing list