diff options
author | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-09-17 07:01:11 +0000 |
---|---|---|
committer | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-09-17 07:01:11 +0000 |
commit | d1a64350850b72c12973296a1126059d288d1f4c (patch) | |
tree | 31d8b36fa313f0878513ac28178a92704ead8962 /gcc/cp/lex.c | |
parent | e20bf7212eeae6c290251c325bef2e9d9582c262 (diff) | |
download | gcc-d1a64350850b72c12973296a1126059d288d1f4c.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@87633 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/lex.c')
-rw-r--r-- | gcc/cp/lex.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c index 6157b7f10ff..4fa1645d6a2 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; } } |