aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/lex.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2004-09-17 07:01:11 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2004-09-17 07:01:11 +0000
commit996c2b52487b8de1dff2ebe4b7183e70fc2bf8fa (patch)
tree31d8b36fa313f0878513ac28178a92704ead8962 /gcc/cp/lex.c
parent275a4187085d13c53f0cb27ca74d3d73cebd58f9 (diff)
downloadgcc-996c2b52487b8de1dff2ebe4b7183e70fc2bf8fa.zip
gcc-996c2b52487b8de1dff2ebe4b7183e70fc2bf8fa.tar.gz
gcc-996c2b52487b8de1dff2ebe4b7183e70fc2bf8fa.tar.bz2
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
Diffstat (limited to 'gcc/cp/lex.c')
-rw-r--r--gcc/cp/lex.c3
1 files changed, 3 insertions, 0 deletions
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;
}
}