template struct X {}; template struct X { typedef double* type; type foo () const; }; template typename X::type X::foo () const {}