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
This commit is contained in:
Alexandre Oliva 2002-02-20 23:10:36 +00:00 committed by Alexandre Oliva
parent 7552da58e1
commit 3704ef744f
2 changed files with 10 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2002-02-20 Alexandre Oliva <aoliva@redhat.com>
* c-decl.c (pushdecl): If no global declaration is found for an
extern declaration in block scope, try a limbo one.
2002-02-20 Jakub Jelinek <jakub@redhat.com>
PR c++/4401

View File

@ -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)