[Bug c++/90489] New: Attributes no longer allowed in lambdas with trailing return type

mathias at gaunard dot com gcc-bugzilla@gcc.gnu.org
Wed May 15 15:35:00 GMT 2019


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

            Bug ID: 90489
           Summary: Attributes no longer allowed in lambdas with trailing
                    return type
           Product: gcc
           Version: 9.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mathias at gaunard dot com
  Target Milestone: ---

As of GCC 8.2, the following code is well-formed:
auto const f = [](int) __attribute__((always_inline)) -> int { return 0; };

With GCC 9.1, it fails to compile.

Note however that the following remains valid:
auto const f = [](int) __attribute__((always_inline)) { return 0; };
So it looks like there is some bad interaction in the parsing between
attributes and the late return type.


More information about the Gcc-bugs mailing list