Forward Declarations in GCC4
by Christopher Van Horn · in Torque Game Builder · 01/19/2006 (7:29 am) · 2 replies
I have discovered when using GCC4 "friend class xyz;" does not actually declare the class xyz.
Using "friend class xyz;" will give you the following error:
"ISO C++ forbids declaration of xyz with no type"
You have to change it to just "class xyz;" It is listed in gcc's bugzilla here.
Using "friend class xyz;" will give you the following error:
"ISO C++ forbids declaration of xyz with no type"
You have to change it to just "class xyz;" It is listed in gcc's bugzilla here.
Torque Owner David .NfoCipher. Bunt
Default Studio Name
Not a bug. The clause you referred to: "A name nominated by a friend declaration shall be accessible in the scope of the class containing the friend declaration." actually means that the following code is not allowed: class A { class B {}; }; class C { friend class A::B; // Error - A::B is not accessible inside C }; For your case, look at 11.4 paragraph 9: "For a friend class declaration, if there is no prior declaration, the class that is specified belongs to the innermost enclosing non-class scope, but if it is subsequently referenced, its name is not found by name lookup until a matching declaration is provided in the innermost enclosing nonclass scope."