https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86171
--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> --- A well-formed variant: template <class> struct A; template <class T> using B = typename A<T>::X; template <class T> struct A { typedef int X; typedef B<T> U; }; B<short> b;