template struct B { typedef typename T::X X; }; template struct A { typedef B::X::Y Z; }; // { dg-error "" }