https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71794
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> --- If you fix your partial specialization it works with all compilers: template <typename T, std::size_t N> /* correct type */ struct B<std::array<T, N>> { static std::array<T, N> bar() { return std::array<T, N>(); } };