template<typename T> class A; template<typename T> class A { public: template<typename R> friend class A<R>; }; int main() { return 0; } gets: ~/ootbc/common/test/src$ g++ foo.cc foo.cc:6: error: partial specialization `A<R>' declared `friend' Is this a bug, a hole in the language, or are you supposed to declare mutual friendship some other way? Ivan
14.5.3 - Friends [temp.friend], p9, says that "Friend declarations shall not declare partial specializations." I think it is time to sometime to use google to check first if there is a bug. Also I think this is a hole in the language.