First of all the typedef is defined in the scope of the class. So the compiler can not find the definition of the typedef if it is used as unqualified name as a return type. You could write for example
myclass::inttest myclass::foo() { }
However the compiler again will issue an error because the typedef is defined as private.
EDIT: I am sorry. The definition of the function I showed will be compiled.
However in the code that calls the function you will need to write either
myclass a;
int i = a.foo();
or
myclass a;
auto i = a.foo();
You may not write
myclass a;
myclass::inttest i = a.foo();