friends and inner classes

Jason Merrill jason@cygnus.com
Fri Jun 5 01:32:00 GMT 1998


>>>>> Nyny  <Nyny.sxthree@penfeld.tls.mms.fr> writes:

> foo.cc:10: member `foo::func(foo::bar *)' declared as friend before type
> `foo' defined

> C++ draft of dec 96 (Where can I get a newer one ?????) says that the
> identifier `foo' must be defined in the scope of the class definition. I
> think g++ is wrong at least with the error message cuz foo is indeed
> defined.  Am I missing something ??

No, you're right.  g++ is wrong.  One day this will get fixed.  Actually, I
planned to fix this when I implemented namespaces, but Martin beat me to it.

Jason



More information about the Gcc-bugs mailing list