// PR37314 rejects-valid, from w.doeringer template struct A { typedef __PTRDIFF_TYPE__ difference_type; struct B { typedef typename A::difference_type difference_type; difference_type operator-(B const&) const; T t; }; }; // template typename A::B::difference_type A::B::operator-(B const&) const { return -1; } // int main() { A::B i; ++i.t; return 0; }