c-decl.c (pushdecl): If no global declaration is found for an extern declaration...
authorAlexandre Oliva <aoliva@redhat.com>
Wed, 20 Feb 2002 23:10:36 +0000 (23:10 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Wed, 20 Feb 2002 23:10:36 +0000 (23:10 +0000)
* c-decl.c (pushdecl): If no global declaration is found for an
extern declaration in block scope, try a limbo one.

From-SVN: r49917

gcc/ChangeLog
gcc/c-decl.c

index 59d8288a77a0da3565ed87b0cedd181462fab360..9538ca24128306e685017cb1cd6efed855b5586f 100644 (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
index 6e7c3ca78c0d09db465469fdae92340e54284f94..23c37ef8d93ae1473def30611409676d73882e2c 100644 (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)