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

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Marek Polacek <mpola...@gcc.gnu.org>:

https://gcc.gnu.org/g:78cd6a63ee67ed854fbe54dd7c0a500dc138459a

commit r11-5230-g78cd6a63ee67ed854fbe54dd7c0a500dc138459a
Author: Marek Polacek <pola...@redhat.com>
Date:   Tue Nov 17 11:38:25 2020 -0500

    c++: Allow template lambdas without lambda-declarator [PR97839]

    Our implementation of template lambdas incorrectly requires the optional
    lambda-declarator.  This was probably required by an early draft of
    generic lambdas, but now the production is [expr.prim.lambda.general]:

     lambda-expression:
        lambda-introducer lambda-declarator [opt] compound-statement
        lambda-introducer < template-parameter-list > requires-clause [opt]
              lambda-declarator [opt] compound-statement

    Therefore, we should accept the following test.

    gcc/cp/ChangeLog:

            PR c++/97839
            * parser.c (cp_parser_lambda_declarator_opt): Don't require ().

    gcc/testsuite/ChangeLog:

            PR c++/97839
            * g++.dg/cpp2a/lambda-generic8.C: New test.

Reply via email to