]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Undo this patch, breaks libobjc builds.
authorDoug Evans <dje@gnu.org>
Sun, 5 Mar 1995 23:27:16 +0000 (23:27 +0000)
committerDoug Evans <dje@gnu.org>
Sun, 5 Mar 1995 23:27:16 +0000 (23:27 +0000)
* c-decl.c (pushdecl): When have a duplicate decl, and it is global,
delete lookup_name name in test for return.
(redeclaration_error_message): When newdecl is a block level
declaration, use lookup_name_current_level instead of DECL_CONTEXT.

From-SVN: r9123

gcc/c-decl.c

index 86c1024677da2f680773c552617ea9a9f7bea3ae..0b3bb17554bee92a1dac653d3ebe5a5927d6ebf7 100644 (file)
@@ -1939,11 +1939,11 @@ pushdecl (x)
                                          IDENTIFIER_POINTER (name));
            }
 
-         /* If this is a global decl, then we can't return as yet, because we
-            need to register this decl in the current binding block.  This
-            ensures that we get an error message if it is redeclared as a
-            local variable later in the same block.  */
-         if (! DECL_EXTERNAL (x) || ! TREE_PUBLIC (x))
+         /* If this is a global decl, and there exists a conflicting local
+            decl in a parent block, then we can't return as yet, because we
+            need to register this decl in the current binding block.  */
+         if (! DECL_EXTERNAL (x) || ! TREE_PUBLIC (x)
+             || lookup_name (name) == t)
            return t;
        }
 
@@ -2422,7 +2422,7 @@ redeclaration_error_message (newdecl, olddecl)
         external reference.  Otherwise, it is OK, because newdecl must
         be an extern reference to olddecl.  */
       if (!(DECL_EXTERNAL (newdecl) && DECL_EXTERNAL (olddecl))
-         && lookup_name_current_level (DECL_NAME (newdecl)) == olddecl)
+         && DECL_CONTEXT (newdecl) == DECL_CONTEXT (olddecl))
        return "redeclaration of `%s'";
       return 0;
     }