c++: Allow GNU attributes before lambda -> [PR90333]
authorJason Merrill <jason@redhat.com>
Fri, 26 Feb 2021 10:45:02 +0000 (05:45 -0500)
committerJason Merrill <jason@redhat.com>
Sat, 27 Feb 2021 20:44:27 +0000 (15:44 -0500)
commit5d9d6c1cd8d9f0e057b4a7a849bc765e2109137c
tree4a578cbc7ef322b2a6dbd134d0d8a37b3d36098b
parenta938e4616d62b020760e715902ee5edc0206498d
c++: Allow GNU attributes before lambda -> [PR90333]

In my 9.3/10 patch for 90333 I allowed attributes between [] and (), and
after the trailing return type, but not in the place that GCC 8 expected
them, and we've gotten several bug reports about that.  So let's allow them
there, as well.

gcc/cp/ChangeLog:

PR c++/90333
* parser.c (cp_parser_lambda_declarator_opt): Accept GNU attributes
between () and ->.

gcc/testsuite/ChangeLog:

PR c++/90333
* g++.dg/ext/attr-lambda3.C: New test.
gcc/cp/parser.c
gcc/testsuite/g++.dg/ext/attr-lambda3.C [new file with mode: 0644]