c++: Implement P1102R2 - Down with ()!
authorJakub Jelinek <jakub@redhat.com>
Fri, 26 Feb 2021 09:44:52 +0000 (10:44 +0100)
committerJakub Jelinek <jakub@redhat.com>
Fri, 26 Feb 2021 09:47:07 +0000 (10:47 +0100)
commit0f161cc8494cf7283a16fa9ebbcf8fd121bab68d
tree4962d03899c296616a087ba3740a2df3a5f6beca
parent27f9a87886d48448f83e0e559dcf028b1a4a4ec6
c++: Implement P1102R2 - Down with ()!

The following patch implements P1102R2.
For attributes, we have already attribute parsing before the parameter
declarations and so when that is omitted, if the attributes are first we
already accept it.

2021-02-26  Jakub Jelinek  <jakub@redhat.com>

* parser.c (cp_parser_lambda_declarator_opt): Implement
P1102R2 - Down with ()! Make ()s optional before lambda specifiers
for -std={c,gnu}++2b or with pedwarn in earlier versions.

* g++.dg/cpp23/lambda-specifiers1.C: New test.
gcc/cp/parser.c
gcc/testsuite/g++.dg/cpp23/lambda-specifiers1.C [new file with mode: 0644]