// PR c++/53403 template class Foo { typedef void type; template friend void f(); public: Foo() {} }; template class Foo; template void f() { typedef Foo::type type; } int main() { f(); }