[Bug c++/95883] Attributes on lambdas appear to be parsed in the wrong place
patrick.a.moran at gmail dot com
gcc-bugzilla@gcc.gnu.org
Mon Jun 29 21:12:11 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95883
Patrick Moran <patrick.a.moran at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |patrick.a.moran at gmail dot com
--- Comment #3 from Patrick Moran <patrick.a.moran at gmail dot com> ---
My argument in favor of restoring the pre-9-series behavior is that of compiler
portability. When you have a lambda with a trailing return type that you want
to mark with __attribute__((always_inline)) there's now one syntax that works
with GCCs before 9.1 and with clang (who is matching gcc), and another syntax
that works with GCCs after 9.3, but not with any GCC before 9.3 or any version
of clang. If you want to write code that works with GCC 8.3 and 10.1, or with
both GCC 10.1 and any clang, then you have to write macros to move the
attributes around.
Whereas if the patch in this bug (or another like it), then at least the one
existing codebase I'm working on won't have to add a macro layer to be able to
support lambdas across our range of supported compilers.
More information about the Gcc-bugs
mailing list