[Bug c++/60503] gcc looks for C++ attributes in the wrong place in a lambda-expression

jason at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Nov 5 07:47:00 GMT 2018


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

--- Comment #1 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Mon Nov  5 07:46:52 2018
New Revision: 265787

URL: https://gcc.gnu.org/viewcvs?rev=265787&root=gcc&view=rev
Log:
        PR c++/60503 - wrong lambda attribute syntax.

This patch fixes two issues with lambda attribute handling: First, it was in
the wrong place in the grammar.  Second, it was treating attributes as
applying to the whole declaration rather than to the function type, as
specified by the standard.

        * parser.c (cp_parser_lambda_declarator_opt): Fix attribute
        handling.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-attr1.C
    trunk/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-attr2.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/parser.c


More information about the Gcc-bugs mailing list