'identifier' : 'friend' cannot be used during type definition
The friend declaration includes a complete class declaration. A friend declaration can specify a member function or an elaborated type specifier, but not a complete class declaration.
Example
class D { void func( int ); }; class A { friend class B { int i; }; // error friend class C; // OK friend void D::func(int); // OK };