diff options
author | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-10-11 06:19:55 +0000 |
---|---|---|
committer | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-10-11 06:19:55 +0000 |
commit | 1563f282fb8d1baece943666d6bef82bdaee1e9d (patch) | |
tree | 409de251d2e760264b6f7cdcef9c4d4b8cc2fe13 /gcc/toplev.c | |
parent | 659203b81e9b5956d9b56b7c23153c1242f1faad (diff) | |
download | gcc-1563f282fb8d1baece943666d6bef82bdaee1e9d.tar.gz |
PR c++/24302
* toplev.c (check_global_declaration_1): Robustify.
PR c++/24302
* g++.dg/warn/Wunused-12.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@105222 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/toplev.c')
-rw-r--r-- | gcc/toplev.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c index 796c7bf87e5..eea9ab20ead 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. */ |