This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[C++ PATCH for 3.4, committed] Fix PR9188
- From: Kriang Lerdsuwanakij <lerdsuwa at users dot sourceforge dot net>
- To: <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 6 Mar 2003 21:54:28 +0700 (ICT)
- Subject: [C++ PATCH for 3.4, committed] Fix PR9188
- Reply-to: <lerdsuwa at users dot sourceforge dot net>
Hi
I committed an obvious patch regarding to error message displayed
during parsing. As reported in PR9188, we sometimes emit
diagnostics like
error: expected expected `;'
where the word `expected' appears twice in the message.
Tested on i686-pc-linux-gnu.
--Kriang
2003-03-06 Kriang Lerdsuwanakij <lerdsuwa at users dot sourceforge dot net>
PR c++/9188
* parser.c (cp_parser_type_parameter): Remove redundant `expect'
in error message.
(cp_parser_single_declaration): Likewise.
*** gcc-main-save/gcc/cp/parser.c Sat Mar 1 14:04:59 2003
--- gcc-main-new/gcc/cp/parser.c Thu Mar 6 21:30:35 2003
*************** cp_parser_type_parameter (cp_parser* par
*** 7754,7760 ****
/* Look for a keyword to tell us what kind of parameter this is. */
token = cp_parser_require (parser, CPP_KEYWORD,
! "expected `class', `typename', or `template'");
if (!token)
return error_mark_node;
--- 7754,7760 ----
/* Look for a keyword to tell us what kind of parameter this is. */
token = cp_parser_require (parser, CPP_KEYWORD,
! "`class', `typename', or `template'");
if (!token)
return error_mark_node;
*************** cp_parser_single_declaration (cp_parser*
*** 13992,13998 ****
parser->qualifying_scope = NULL_TREE;
parser->object_scope = NULL_TREE;
/* Look for a trailing `;' after the declaration. */
! if (!cp_parser_require (parser, CPP_SEMICOLON, "expected `;'")
&& cp_parser_committed_to_tentative_parse (parser))
cp_parser_skip_to_end_of_block_or_statement (parser);
/* If it worked, set *FRIEND_P based on the DECL_SPECIFIERS. */
--- 13992,13998 ----
parser->qualifying_scope = NULL_TREE;
parser->object_scope = NULL_TREE;
/* Look for a trailing `;' after the declaration. */
! if (!cp_parser_require (parser, CPP_SEMICOLON, "`;'")
&& cp_parser_committed_to_tentative_parse (parser))
cp_parser_skip_to_end_of_block_or_statement (parser);
/* If it worked, set *FRIEND_P based on the DECL_SPECIFIERS. */