diff options
author | Benjamin Kosnik <bkoz@rhino.cygnus.com> | 1997-12-05 00:48:46 +0000 |
---|---|---|
committer | Brendan Kehoe <brendan@gcc.gnu.org> | 1997-12-04 19:48:46 -0500 |
commit | 249555b0af353de199f224a21a88143e375e8183 (patch) | |
tree | 15dcae23f86e458e00f5f7abfb050406cb3d0a9a /gcc | |
parent | e7757d691986cb364eab8f8a6968ff385d4d3a61 (diff) | |
download | gcc-249555b0af353de199f224a21a88143e375e8183.zip gcc-249555b0af353de199f224a21a88143e375e8183.tar.gz gcc-249555b0af353de199f224a21a88143e375e8183.tar.bz2 |
missing part of Sept 22 change brought over:
* decl.c (cp_finish_decl): Mark decls used if type has TREE_USED
set,don't clear TREE_USED wholesale.
From-SVN: r16953
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/decl.c | 7 |
2 files changed, 13 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index c7c56d3..dfe5121 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -788,6 +788,12 @@ Thu Sep 25 11:11:13 1997 Jason Merrill <jason@yorick.cygnus.com> * decl.c (start_function): Up warning of no return type to be a pedwarn. +Mon Sep 22 14:15:34 1997 Benjamin Kosnik <bkoz@rhino.cygnus.com> + + * init.c (expand_member_init): Don't set TREE_USED. + * decl.c (cp_finish_decl): Mark decls used if type has TREE_USED + set,don't clear TREE_USED wholesale. + Sat Sep 20 15:31:00 1997 Jason Merrill <jason@yorick.cygnus.com> * call.c (build_over_call): Do require_complete_type before diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 2a57fa9..23307e9 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -6956,6 +6956,10 @@ cp_finish_decl (decl, init, asmspec_tree, need_pop, flags) was initialized was ever used. Don't do this if it has a destructor, so we don't complain about the 'resource allocation is initialization' idiom. */ + /* Now set attribute((unused)) on types so decls of + of that type will be marked used. (see TREE_USED, above.) + This avoids the warning problems this particular code + tried to work around. */ if (TYPE_NEEDS_CONSTRUCTING (type) && ! already_used @@ -7797,6 +7801,9 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist) init = TREE_OPERAND (decl, 1); decl = start_decl (declarator, declspecs, 1); + /* Look for __unused__ attribute */ + if (TREE_USED (TREE_TYPE (decl))) + TREE_USED (decl) = 1; finish_decl (decl, init, NULL_TREE); return 0; } |