https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91271
Bug ID: 91271 Summary: class template specialization on std::array failed Product: gcc Version: 9.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: zhangbonian17 at 163 dot com Target Milestone: --- This is the offending code. It compiles successfully on clang/msvc recent versions. #include <array> template<typename T> struct debug_t; template<typename T> struct A{ /*use the primary template will cause the error*/ static void _() {debug_t<T> d;} }; template<typename T,int N> struct A<std::array<T,N>> { static void _() {} }; int main() { A<std::array<int,2>>::_(); }