// PR c++/46046 template struct foo { template struct type {}; template struct type< typename T::template some_type, V > {}; }; template class bar {}; int main() { typedef foo > cont; cont::type obj; // { dg-error "cannot be defined" } }