https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70141
--- Comment #4 from Markus Trippelsdorf <trippels at gcc dot gnu.org> --- I'm not sure this is a compiler bug at all. Even clang warns: foo.ii:10:32: warning: class template partial specialization contains a template parameter that cannot be deduced; this partial specialization will never be used template <typename U> struct predicate<typename outer<T>::template inner<U>> { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ foo.ii:10:22: note: non-deducible template parameter 'U' template <typename U> struct predicate<typename outer<T>::template inner<U>> { ^ 1 warning generated.