(do_identifier): Use global binding in preference of dead for local
authorPer Bothner <bothner@kalessin.cygnus.com>
Thu, 14 Sep 1995 21:06:54 +0000 (17:06 -0400)
committerRichard Kenner <kenner@gcc.gnu.org>
Thu, 14 Sep 1995 21:06:54 +0000 (17:06 -0400)
variable.

From-SVN: r10352

gcc/cp/lex.c

index 2188570..c767349 100644 (file)
@@ -2920,6 +2920,8 @@ do_identifier (token)
   if (TREE_CODE (id) == VAR_DECL && DECL_DEAD_FOR_LOCAL (id))
     {
       tree shadowed = DECL_SHADOWED_FOR_VAR (id);
+      if (!shadowed)
+       shadowed = IDENTIFIER_GLOBAL_VALUE (DECL_NAME (id));
       if (shadowed)
        {
          if (!DECL_ERROR_REPORTED (id))