This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/33255] A warning for "unused" typedefs?
- From: "dodji at seketeli dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 25 Jul 2011 11:18:22 +0000
- Subject: [Bug c++/33255] A warning for "unused" typedefs?
- Auto-submitted: auto-generated
- References: <bug-33255-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33255
--- Comment #21 from dodji at seketeli dot org <dodji at seketeli dot org> 2011-07-25 11:17:11 UTC ---
> --- Comment #18 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-07-24 22:37:39 UTC ---
> By the way, an obvious positive additional testcase, involving templates, would
> be one inspired by libstdc++/33084 that is involving <valarray> *before* the
> fix for that bug. Shouldn't be too hard to figure out...
Thanks for the pointer. I am adding this (hopefully equivalent) test
case to the patch:
+
+template<class T, class U>
+struct S10
+{
+};
+
+template<class T>
+void
+test10(void)
+{
+ typedef typename ST<T>::T bar; // { dg-warning "locally defined but not
used" }
+ typedef typename ST<T>::T foo; // We shouldn't warn for this one, as
+ // it's used below.
+ S10<int, foo> v;
+}