https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94951
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Slightly simplified testcase: struct A { unsigned a[32]; }; template <int N> struct B : public A { static B<N> foo () { B<N> t; t.a[0] = 4; return t; } };