3797cb21ff
gcc/ * c-decl.c (lookup_name): Use the new maybe_record_typedef_use. (pushdecl): Use the new record_locally_defined_typedef. (store_parm_decls): Allocate cfun->language. (finish_function): Use the new maybe_warn_unused_local_typedefs, and free cfun->language. (c_push_function_context): Allocate cfun->language here only if needed. (c_pop_function_context): Likewise, mark cfun->language for collection only when it should be done. * c-common.c (handle_used_attribute): Don't ignore TYPE_DECL nodes. * c-typeck.c (c_expr_sizeof_type, c_cast_expr): Use the new maybe_record_local_typedef_use. gcc/c-family * c-common.h (struct c_language_function::local_typedefs): New field. (record_locally_defined_typedef, maybe_record_typedef_use) (maybe_warn_unused_local_typedefs): Declare new functions. * c-common.c (record_locally_defined_typedef) (maybe_record_typedef_use) (maybe_warn_unused_local_typedefs): Define new functions. * c.opt: Declare new -Wunused-local-typedefs flag. gcc/cp * name-lookup.c (pushdecl_maybe_friend_1): Use the new record_locally_defined_typedef. * decl.c (finish_function): Use the new maybe_warn_unused_local_typedefs. (grokfield): Use the new record_locally_defined_typedef. * parser.c (lookup_name): Use the new maybe_record_typedef_use. gcc/doc/ * invoke.texi: Update documentation for -Wunused-local-typedefs. gcc/testsuite/ * g++.dg/warn/Wunused-local-typedefs.C: New test file. * c-c++-common/Wunused-local-typedefs.c: Likewise. libstdc++-v3/ * include/ext/bitmap_allocator.h (__detail::__mini_vector::__lower_bound): Remove unused typedef. * src/istream.cc (std::operator>>(basic_istream<char>& __in, basic_string<char>& __str)): Likewise. (std::getline): Likewise. * src/valarray.cc (__valarray_product): Likewise. From-SVN: r178692 |
||
---|---|---|
.. | ||
pb_ds | ||
algorithm | ||
alloc_traits.h | ||
array_allocator.h | ||
atomicity.h | ||
bitmap_allocator.h | ||
cast.h | ||
codecvt_specializations.h | ||
concurrence.h | ||
debug_allocator.h | ||
enc_filebuf.h | ||
extptr_allocator.h | ||
functional | ||
iterator | ||
malloc_allocator.h | ||
memory | ||
mt_allocator.h | ||
new_allocator.h | ||
numeric | ||
numeric_traits.h | ||
pod_char_traits.h | ||
pointer.h | ||
pool_allocator.h | ||
rb_tree | ||
rc_string_base.h | ||
rope | ||
ropeimpl.h | ||
slist | ||
sso_string_base.h | ||
stdio_filebuf.h | ||
stdio_sync_filebuf.h | ||
string_conversions.h | ||
throw_allocator.h | ||
type_traits.h | ||
typelist.h | ||
vstring_fwd.h | ||
vstring_util.h | ||
vstring.h | ||
vstring.tcc |