summaryrefslogtreecommitdiffstats
path: root/contrib/gcc/cp/lex.c
diff options
context:
space:
mode:
authorkan <kan@FreeBSD.org>2006-08-26 21:29:10 +0000
committerkan <kan@FreeBSD.org>2006-08-26 21:29:10 +0000
commitab6c6e434e4ca0bf593007d49dee6eceb73286c0 (patch)
tree843ffc6140f66bf60562adb1bf8d3d82b9739b5e /contrib/gcc/cp/lex.c
parent8a6911d2bb988a943624cbf4e4041b827d9ade53 (diff)
downloadFreeBSD-src-ab6c6e434e4ca0bf593007d49dee6eceb73286c0.zip
FreeBSD-src-ab6c6e434e4ca0bf593007d49dee6eceb73286c0.tar.gz
Gcc 3.4.6 as of 2006/08/25 #116475.
Diffstat (limited to 'contrib/gcc/cp/lex.c')
-rw-r--r--contrib/gcc/cp/lex.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/contrib/gcc/cp/lex.c b/contrib/gcc/cp/lex.c
index 2239c76..66e45ed 100644
--- a/contrib/gcc/cp/lex.c
+++ b/contrib/gcc/cp/lex.c
@@ -627,26 +627,18 @@ unqualified_name_lookup_error (tree name)
if (name != ansi_opname (ERROR_MARK))
error ("`%D' not defined", name);
}
- else if (current_function_decl == 0)
- error ("`%D' was not declared in this scope", name);
else
{
- if (IDENTIFIER_NAMESPACE_VALUE (name) != error_mark_node
- || IDENTIFIER_ERROR_LOCUS (name) != current_function_decl)
+ error ("`%D' was not declared in this scope", name);
+ /* Prevent repeated error messages by creating a VAR_DECL with
+ this NAME in the innermost block scope. */
+ if (current_function_decl)
{
- static int undeclared_variable_notice;
-
- error ("`%D' undeclared (first use this function)", name);
-
- if (! undeclared_variable_notice)
- {
- error ("(Each undeclared identifier is reported only once for each function it appears in.)");
- undeclared_variable_notice = 1;
- }
+ tree decl;
+ decl = build_decl (VAR_DECL, name, error_mark_node);
+ DECL_CONTEXT (decl) = current_function_decl;
+ push_local_binding (name, decl, 0);
}
- /* Prevent repeated error messages. */
- SET_IDENTIFIER_NAMESPACE_VALUE (name, error_mark_node);
- SET_IDENTIFIER_ERROR_LOCUS (name, current_function_decl);
}
return error_mark_node;
OpenPOWER on IntegriCloud