summaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authoraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>2002-02-20 23:10:36 +0000
committeraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>2002-02-20 23:10:36 +0000
commite3a2e7454a78cbf9ff8224977f01a708039b11e8 (patch)
tree1c28552e88dee65c48db7b4762419839fed1b764 /gcc/c-decl.c
parent1c26100feb54696f75afd28258506d4dc564ae7d (diff)
downloadgcc-e3a2e7454a78cbf9ff8224977f01a708039b11e8.tar.gz
* c-decl.c (pushdecl): If no global declaration is found for an
extern declaration in block scope, try a limbo one. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49917 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 6e7c3ca78c0..23c37ef8d93 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -2199,11 +2199,13 @@ pushdecl (x)
not errors. X11 for instance depends on this. */
if (! t && DECL_EXTERNAL (x) && TREE_PUBLIC (x) && ! flag_traditional)
{
- t = lookup_name (name);
+ t = IDENTIFIER_GLOBAL_VALUE (name);
/* Type decls at global scope don't conflict with externs declared
inside lexical blocks. */
- if (t && TREE_CODE (t) == TYPE_DECL)
- t = 0;
+ if (! t || TREE_CODE (t) == TYPE_DECL)
+ /* If there's no visible global declaration, try for an
+ invisible one. */
+ t = IDENTIFIER_LIMBO_VALUE (name);
different_binding_level = 1;
}
if (t != 0 && t == error_mark_node)