This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: c++: Remove the unused has_trailing_semicolon
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org, jason at redhat dot com
- Date: Fri, 10 Apr 2009 07:04:28 -0700
- Subject: Re: PATCH: c++: Remove the unused has_trailing_semicolon
- References: <20090331161735.GA29122@lucon.org>
Hi Jason,
Is this patch OK for trunk?
Thanks.
On Tue, Mar 31, 2009 at 9:17 AM, H.J. Lu <hongjiu.lu@intel.com> wrote:
> Hi,
>
> cp_parser_class_specifier calls cp_lexer_peek_token and set
> has_trailing_semicolon. ?But the result is never used. ?This
> patch removes them. ?OK for trunk?
>
> Thanks.
>
>
> H.J.
> ---
> 2008-03-31 ?H.J. Lu ?<hongjiu.lu@intel.com>
>
> ? ? ? ?* parser.c (cp_parser_class_specifier): Remove the unused
> ? ? ? ?has_trailing_semicolon.
>
> --- gcc/cp/parser.c.foo 2009-03-31 07:48:26.000000000 -0700
> +++ gcc/cp/parser.c ? ? 2009-03-31 09:14:28.000000000 -0700
> @@ -14925,10 +14925,8 @@ cp_parser_class_name (cp_parser *parser,
> ?static tree
> ?cp_parser_class_specifier (cp_parser* parser)
> ?{
> - ?cp_token *token;
> ? tree type;
> ? tree attributes = NULL_TREE;
> - ?int has_trailing_semicolon;
> ? bool nested_name_specifier_p;
> ? unsigned saved_num_template_parameter_lists;
> ? bool saved_in_function_body;
> @@ -15006,10 +15004,6 @@ cp_parser_class_specifier (cp_parser* pa
>
> ? /* Look for the trailing `}'. ?*/
> ? cp_parser_require (parser, CPP_CLOSE_BRACE, "%<}%>");
> - ?/* We get better error messages by noticing a common problem: a
> - ? ? missing trailing `;'. ?*/
> - ?token = cp_lexer_peek_token (parser->lexer);
> - ?has_trailing_semicolon = (token->type == CPP_SEMICOLON);
> ? /* Look for trailing attributes to apply to this class. ?*/
> ? if (cp_parser_allow_gnu_extensions_p (parser))
> ? ? attributes = cp_parser_attributes_opt (parser);
>
--
H.J.