diff options
author | Alexandre Oliva <aoliva@redhat.com> | 2002-02-20 23:10:36 +0000 |
---|---|---|
committer | Alexandre Oliva <aoliva@gcc.gnu.org> | 2002-02-20 23:10:36 +0000 |
commit | 3704ef744f0b39b4c28d84bef7702644b62ccefb (patch) | |
tree | 1c28552e88dee65c48db7b4762419839fed1b764 /gcc/c-decl.c | |
parent | 7552da58e17fb0e2c53a03bd986eee6baea79730 (diff) | |
download | gcc-3704ef744f0b39b4c28d84bef7702644b62ccefb.zip gcc-3704ef744f0b39b4c28d84bef7702644b62ccefb.tar.gz gcc-3704ef744f0b39b4c28d84bef7702644b62ccefb.tar.bz2 |
c-decl.c (pushdecl): If no global declaration is found for an extern declaration in block scope...
* c-decl.c (pushdecl): If no global declaration is found for an
extern declaration in block scope, try a limbo one.
From-SVN: r49917
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 6e7c3ca..23c37ef 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) |