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; +}