https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55809
--- Comment #3 from Nathan Sidwell <nathan at gcc dot gnu.org> --- I think it's ill-formed. the parameter is a non-type template parameter, using a qualified-id containing a dependent type. As such typename T::X * is correct. Using class there is ill-formed. typename and class are only synonyms when naming a type-parameter-key.