aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPer Bothner <bothner@kalessin.cygnus.com>1995-09-14 17:06:54 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1995-09-14 17:06:54 -0400
commitb1c8f01ae978448774a0c397b14d9f32cfe16731 (patch)
treee232f134fce263fb1a5ea4004449c324543c69a8
parent38267a708790cdbae9bcc70a193dc7c19629e78f (diff)
downloadgcc-b1c8f01ae978448774a0c397b14d9f32cfe16731.zip
gcc-b1c8f01ae978448774a0c397b14d9f32cfe16731.tar.gz
gcc-b1c8f01ae978448774a0c397b14d9f32cfe16731.tar.bz2
(do_identifier): Use global binding in preference of dead for local
variable. From-SVN: r10352
-rw-r--r--gcc/cp/lex.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c
index 2188570..c767349 100644
--- a/gcc/cp/lex.c
+++ b/gcc/cp/lex.c
@@ -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))