This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Simplify cp_parser_template_parameter_list


The following trivial patch simplifies cp_parser_template_parameter_list
by using cp_lexer_next_token_is_not instead of duplicating the code.

Bootstrapped and regtested on i686-pc-linux-gnu.
Ok for mainline?

Regards,
Volker

:ADDPATCH C++:


2008-03-28  Volker Reichelt  <v.reichelt@netcologne.de>

	* parser.c (cp_parser_template_parameter_list): Simplify.

===================================================================
--- gcc/cp/parser.c	2006-08-19 15:16:15 +0200
+++ gcc/cp/parser.c	2006-08-19 15:15:58 +0200
@@ -9303,7 +9303,6 @@ cp_parser_template_parameter_list (cp_pa
   while (true)
     {
       tree parameter;
-      cp_token *token;
       bool is_non_type;
       bool is_parameter_pack;
 
@@ -9324,10 +9323,8 @@ cp_parser_template_parameter_list (cp_pa
          parameter_list = chainon (parameter_list, err_parm);
        }
 
-      /* Peek at the next token.  */
-      token = cp_lexer_peek_token (parser->lexer);
-      /* If it's not a `,', we're done.  */
-      if (token->type != CPP_COMMA)
+      /* If the next token is not a `,', we're done.  */
+      if (cp_lexer_next_token_is_not (parser->lexer, CPP_COMMA))
 	break;
       /* Otherwise, consume the `,' token.  */
       cp_lexer_consume_token (parser->lexer);
===================================================================


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]