From 996c2b52487b8de1dff2ebe4b7183e70fc2bf8fa Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Fri, 17 Sep 2004 07:01:11 +0000 Subject: re PR c++/16002 (Strange error message with new parser) PR c++/16002 * parser.c (cp_parser_simple_declaration): Commit to tentative parses after seeing a decl-specifier. (cp_parser_simple_declaration): Eliminate spurious message. (cp_parser_init_declarator): Adjust error message. PR c++/16029 * lex.c (unqualified_name_lookup_error): Mark the dummy declaration as used. PR c++/16002 * g++.dg/template/error18.C: New test. PR c++/16029 * g++.dg/warn/Wunused-8.C: New test. From-SVN: r87633 --- gcc/cp/lex.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gcc/cp/lex.c') diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c index 6157b7f..4fa1645 100644 --- a/gcc/cp/lex.c +++ b/gcc/cp/lex.c @@ -572,6 +572,9 @@ unqualified_name_lookup_error (tree name) decl = build_decl (VAR_DECL, name, error_mark_node); DECL_CONTEXT (decl) = current_function_decl; push_local_binding (name, decl, 0); + /* Mark the variable as used so that we do not get warnings + about it being unused later. */ + TREE_USED (decl) = 1; } } -- cgit v1.1