http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58031
Bug ID: 58031 Summary: invalid class template partial specialization accepted where argument list identical to primary template Product: gcc Version: 4.9.0 Status: UNCONFIRMED Keywords: accepts-invalid Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: redi at gcc dot gnu.org template<template<typename...> class T> struct X { }; template<template<typename> class T> struct X<T> { }; template<typename T> struct Y { }; X<Y> x; The partial specialization is ill-formed, 14.5.5 [temp.class.spec] p8 says Within the argument list of a class template partial specialization, the following restrictions apply: - [...] - [...] - The argument list of the specialization shall not be identical to the implicit argument list of the primary template. The implicit argument list of the primary template is T, which is identical to that of the partial specialization. Clang and MSVC reject it.