gcc/gcc/cp
Dodji Seketeli d10402b413 PR c++/54372 - unused attribute inactive on dependant entities
In the example of this patch, gcc/g++ invoked with
-Wunused-local-typedefs warns on dependant entities even when those
are decorated with the 'unused' attribute.

This is because in cplus_decl_attributes, save_template_attributes
makes so that the 'unused' attribute is applied to its appertaining
entity only at instantiation time.  But then at parsing time
maybe_warn_unused_local_typedefs checks for TREE_USED before warning.

This patch applies the 'unused' attribute at compilation time.

Tested on x86_64-unknown-linux-gnu against trunk.

gcc/cp/

	* decl2.c (is_late_template_attribute): "unused" attribute is to
	be applied at compile time.

gcc/testsuite/

	* c-c++-common/Wunused-local-typedefs-2.c: New test.

From-SVN: r191830
2012-09-28 15:32:41 +02:00
..
ChangeLog PR c++/54372 - unused attribute inactive on dependant entities 2012-09-28 15:32:41 +02:00
ChangeLog-1993
ChangeLog-1994
ChangeLog-1995
ChangeLog-1996
ChangeLog-1997
ChangeLog-1998
ChangeLog-1999
ChangeLog-2000
ChangeLog-2001
ChangeLog-2002
ChangeLog-2003
ChangeLog-2004
ChangeLog-2005
ChangeLog-2006
ChangeLog-2007
ChangeLog-2008
ChangeLog-2009
ChangeLog-2010
ChangeLog-2011
ChangeLog.ptr
ChangeLog.tree-ssa
Make-lang.in * Make-lang.in (cp/parser.o): Depend on decl.h. 2012-09-24 11:36:51 -04:00
NEWS
call.c re PR c++/54541 (SFINAE bug: handling incomplete return types) 2012-09-11 01:05:12 +00:00
cfns.gperf
cfns.h
class.c typeck.c (build_indirect_ref, [...]): Remove uses of ATTRIBUTE_UNUSED on the parameters. 2012-09-13 22:20:14 +00:00
config-lang.in
cp-gimplify.c typeck.c (build_indirect_ref, [...]): Remove uses of ATTRIBUTE_UNUSED on the parameters. 2012-09-13 22:20:14 +00:00
cp-lang.c typeck.c (build_indirect_ref, [...]): Remove uses of ATTRIBUTE_UNUSED on the parameters. 2012-09-13 22:20:14 +00:00
cp-objcp-common.c
cp-objcp-common.h
cp-tree.def invoke.texi (-Wsizeof-pointer-memaccess): Document. 2012-08-17 09:17:56 +02:00
cp-tree.h re PR c++/54541 (SFINAE bug: handling incomplete return types) 2012-09-11 01:05:12 +00:00
cvt.c re PR c++/54191 ([C++11] SFINAE does not handle conversion to inaccessible base) 2012-09-05 10:14:37 +00:00
cxx-pretty-print.c cfg.c (debug_bb): Do not set TDF_BLOCKS. 2012-08-07 22:14:29 +00:00
cxx-pretty-print.h
decl.c PR c++/29028 - Missed unused warning on using declaration 2012-09-28 14:51:30 +02:00
decl.h
decl2.c PR c++/54372 - unused attribute inactive on dependant entities 2012-09-28 15:32:41 +02:00
dump.c
error.c re PR c++/50828 (class template parameter not printed for member function template in candidate list) 2012-09-24 16:56:41 +00:00
except.c typeck.c (build_indirect_ref, [...]): Remove uses of ATTRIBUTE_UNUSED on the parameters. 2012-09-13 22:20:14 +00:00
expr.c
friend.c friend.c (make_friend_class): Handle template template parameters. 2012-08-30 22:50:08 -04:00
g++spec.c
init.c init.c (build_new_1): Don't test TREE_CONSTANT of INTEGER_CST. 2012-09-27 13:01:17 +02:00
lang-specs.h
lex.c typeck.c (build_indirect_ref, [...]): Remove uses of ATTRIBUTE_UNUSED on the parameters. 2012-09-13 22:20:14 +00:00
mangle.c Finish conversion of uses of double_int to the new API. 2012-09-24 18:22:31 +00:00
method.c re PR c++/54506 (Defaulted move constructors and move assignment operators are erroneously defined as deleted) 2012-09-10 10:08:32 -04:00
name-lookup.c Remove unnecessary VEC function overloads. 2012-09-10 20:04:13 -04:00
name-lookup.h
operators.def
optimize.c re PR c++/54541 (SFINAE bug: handling incomplete return types) 2012-09-11 01:05:12 +00:00
parser.c re PR c++/54526 ([C++11] <:: is incorrectly treated as digraph <: followed by colon) 2012-09-25 14:44:52 +00:00
parser.h
pt.c re PR c++/52432 ([C++11] -fdump-tree-gimple causes ICE: Error reporting routines re-entered.) 2012-09-20 14:05:19 +00:00
ptree.c
repo.c
rtti.c re PR c++/54541 (SFINAE bug: handling incomplete return types) 2012-09-11 01:05:12 +00:00
search.c typeck.c (build_indirect_ref, [...]): Remove uses of ATTRIBUTE_UNUSED on the parameters. 2012-09-13 22:20:14 +00:00
semantics.c re PR c++/54581 (decltype and opaque vector types) 2012-09-19 20:45:03 +00:00
tree.c typeck.c (build_indirect_ref, [...]): Remove uses of ATTRIBUTE_UNUSED on the parameters. 2012-09-13 22:20:14 +00:00
typeck.c re PR target/50970 (Function pointer dereferenced twice in if statement on Arm cpu) 2012-09-25 06:37:29 +00:00
typeck2.c Finish conversion of uses of double_int to the new API. 2012-09-24 18:22:31 +00:00