Patchwork C++ PATCH to lambda parsing

login
register
mail settings
Submitter Jason Merrill
Date March 17, 2013, 1:53 a.m.
Message ID <51452226.4090502@redhat.com>
Download mbox | patch
Permalink /patch/228266/
State New
Headers show

Comments

Jason Merrill - March 17, 2013, 1:53 a.m.
I noticed that we weren't using cp_parser_trailing_type_id for the case 
in a lambda, and I think we should.

Tested x86_64-pc-linux-gnu, applying to trunk.

Patch

commit 22888aa5a1ab02a32a53a360c857e9dc16ec5f49
Author: Jason Merrill <jason@redhat.com>
Date:   Sat Mar 16 13:56:43 2013 -0400

    	* parser.c (cp_parser_lambda_declarator_opt): Use
    	cp_parser_trailing_type_id.

diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index f4a4278..0222e90 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -8554,7 +8554,8 @@  cp_parser_lambda_declarator_opt (cp_parser* parser, tree lambda_expr)
       if (cp_lexer_next_token_is (parser->lexer, CPP_DEREF))
         {
           cp_lexer_consume_token (parser->lexer);
-          LAMBDA_EXPR_RETURN_TYPE (lambda_expr) = cp_parser_type_id (parser);
+          LAMBDA_EXPR_RETURN_TYPE (lambda_expr)
+	    = cp_parser_trailing_type_id (parser);
         }
 
       /* The function parameters must be in scope all the way until after the