aboutsummaryrefslogtreecommitdiff
path: root/gcc/toplev.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2005-10-11 06:19:55 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2005-10-11 06:19:55 +0000
commiteb2182e29917811d90278a649a100e8bc8c1d13a (patch)
tree409de251d2e760264b6f7cdcef9c4d4b8cc2fe13 /gcc/toplev.c
parent18c75543a89fc2b6a62b3e2967cb89b83fb96ada (diff)
downloadgcc-eb2182e29917811d90278a649a100e8bc8c1d13a.zip
gcc-eb2182e29917811d90278a649a100e8bc8c1d13a.tar.gz
gcc-eb2182e29917811d90278a649a100e8bc8c1d13a.tar.bz2
re PR c++/24302 (anonymous global union segfault with g++ 3.4.x)
PR c++/24302 * toplev.c (check_global_declaration_1): Robustify. PR c++/24302 * g++.dg/warn/Wunused-12.C: New test. From-SVN: r105222
Diffstat (limited to 'gcc/toplev.c')
-rw-r--r--gcc/toplev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 796c7bf..eea9ab2 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -836,7 +836,7 @@ check_global_declaration_1 (tree decl)
&& ! TREE_USED (decl)
/* The TREE_USED bit for file-scope decls is kept in the identifier,
to handle multiple external decls in different scopes. */
- && ! TREE_USED (DECL_NAME (decl))
+ && ! (DECL_NAME (decl) && TREE_USED (DECL_NAME (decl)))
&& ! DECL_EXTERNAL (decl)
&& ! TREE_PUBLIC (decl)
/* A volatile variable might be used in some non-obvious way. */