This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: problem with friend and namespaces
- To: Anthony dot Desportes at ms dot alcatel dot fr
- Subject: Re: problem with friend and namespaces
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Wed, 28 Jun 2000 23:02:44 +0200
- CC: gcc-bugs at gcc dot gnu dot org
- References: <05a701bfe102$a034c3e0$99f709bc@ms.alcatel.fr>
> Is there a problem with friend declarations inside namespaces or with the
> support of the '::' operator ?
Thanks for your bug report. This is indeed a known bug in g++. Please
note that there is an inherent ambiguity in C++, also. If you have
friend A::B::f();
is that
friend A ::B::f(); //function f in namespace B returning A
or
friend A::B ::f(); //global function f returning A::B
This is no problem in your example, but it should give you an idea
about the parsing problems that arise. I had a patch fixing your case
at one time, but it broke other (more important) cases. As a result,
you cannot have qualified names in a friend declaration in g++, sorry.
If somebody volunteers to rewrite the C++ parser, there'd be a chance
that this bug would get fixed as well.
Regards,
Martin