[Bug c++/89640] [9 Regression] g++ chokes on lambda with __attribute__

redbeard0531 at gmail dot com gcc-bugzilla@gcc.gnu.org
Mon Mar 11 14:08:00 GMT 2019


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

--- Comment #2 from Mathias Stearn <redbeard0531 at gmail dot com> ---
Unfortunately the c++ attributes syntax applies to the lambda type rather than
the function, so the warning is correct. The old style __attribute__ syntax
seems to be the only way to annotate the lambda function, which is why we use
it here. We use something like this in a macro around code that builds error
messages on our error paths, which is why it needs to be on a lambda. It made a
notable shrink to the size of our primary .text section moving that stuff out
to the .text.cold section.


More information about the Gcc-bugs mailing list