https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90818
Bug ID: 90818 Summary: Lambda with __attribute__ and explicit return type not accepted Product: gcc Version: 9.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: mark.atkinson99 at gmail dot com Target Milestone: --- A lambda with both __attribute__ and a trailing return type is not accepted. This compiles ok in clang and in gcc <= 8. Omitting the trailing return type works ok. int main() { auto foo = []() __attribute__((cold)) -> bool { return false; }; }