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
+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
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
--- /dev/null
+// 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;
+}