1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
// PR c++/53403 template <typename T> class Foo { typedef void type; template <typename U> friend void f(); public: Foo() {} }; template class Foo<void>; template <typename T> void f() { typedef Foo<void>::type type; } int main() { f<void>(); }