This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: friends and inner classes
- To: Nyny <Nyny dot sxthree at penfeld dot tls dot mms dot fr>
- Subject: Re: friends and inner classes
- From: Alexandre Oliva <oliva at dcc dot unicamp dot br>
- Date: 05 Jun 1998 00:32:39 -0300
- Cc: egcs <egcs dot egcs at cygnus dot com>
- References: <3576D533.279CA15C@penfeld.tls.mms.fr>
Nyny <Nyny.sxthree@penfeld.tls.mms.fr> writes:
> I've already posted that a couple of times but got no answer:
> g++ -c -o foo.o foo.cc
> foo.cc:10: member `foo::func(foo::bar *)' declared as friend before type
> `foo' defined
The code seems correct to me; gcc/egcs should accept it.
Until a patch that fixes this problem is provided, you may work around
this problem by moving the definition of foo::bar outside foo body:
class foo {
class bar;
//...
};
class foo::bar {
//...
};
--
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil
--AAA18016.897017864/grande.dcc.unicamp.br--