https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111314
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- If change DynamicType to a variable length template, then it works; that is: template <template <typename...> class, typename...> struct DynamicType {};