https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104302
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Reduced further: struct ss {}; static ss ff(void* const v); template <unsigned mem_size> void f1(void) { int mem[mem_size]; ss StateRegs[] = { ff(mem) }; } ---- CUT --- mem's array size needs to be value dependent.