Commit 2be9064d by Dodji Seketeli Committed by Dodji Seketeli

PR c++/53551 - -Wunused-local-typedefs misses uses

We don't record the use of a typedef when it's used through a
typename.  Fixed thus.

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

gcc/cp/

	* decl.c (make_typename_type): Record the use of typedefs.

gcc/testsuite/

	* g++.dg/warn/Wunused-local-typedefs-2.C: New test.

From-SVN: r191828
parent 42bace41
2012-09-25 Dodji Seketeli <dodji@redhat.com>
PR c++/53551 - -Wunused-local-typedefs misses uses
* decl.c (make_typename_type): Record the use of typedefs.
2012-09-27 Jakub Jelinek <jakub@redhat.com>
* init.c (build_new_1): Don't test TREE_CONSTANT
......
......@@ -3327,6 +3327,8 @@ make_typename_type (tree context, tree name, enum tag_types tag_type,
if (DECL_ARTIFICIAL (t) || !(complain & tf_keep_type_decl))
t = TREE_TYPE (t);
maybe_record_typedef_use (t);
return t;
}
......
2012-09-25 Dodji Seketeli <dodji@redhat.com>
PR c++/53551 - -Wunused-local-typedefs misses uses
* g++.dg/warn/Wunused-local-typedefs-2.C: New test.
2012-09-28 Jakub Jelinek <jakub@redhat.com>
PR target/54716
......
// Origin PR c++/33255
// { dg-options "-Wunused" } <-- should trigger -Wunused-local-typedefs
// { dg-do compile { target c++11 } }
template <typename C>
struct structure
{
typename C::type val;
};
int
main()
{
struct context
{
using type = int;
};
return structure<context>{42}.val;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment