This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
problem with friend and namespaces
- To: <gcc-bugs at gcc dot gnu dot org>
- Subject: problem with friend and namespaces
- From: "Anthony Desportes" <Anthony dot Desportes at ms dot alcatel dot fr>
- Date: Wed, 28 Jun 2000 15:13:18 +0200
- Organization: Alcatel
- Reply-To: "Anthony Desportes" <Anthony dot Desportes at ms dot alcatel dot fr>
Hello,
I have a problem compiling this code
------------------- the code ------------------
//
// File test.cpp
//
#include <iostream.h>
void f();
namespace NS
{
class A
{
public:
A() {i=6; };
friend void ::f(); // line 14
void foo()
{
::f();
};
private:
int i;
};
};
void f()
{
NS::A a;
cout << "f()" << a.i << endl;
};
void main()
{
NS::A a;
a.foo();
};
--------------------- end of code -----------------------
The GCC version : 2.92.2 on Linux Mandrake 7.0
I tried compiling it with "g++ test.cpp" and got a "parse error before '(' "
on line 14.
Is there a problem with friend declarations inside namespaces or with the
support of the '::' operator ?
I didn't find anything on such a bug.
Thanks in advance.
--
___________________________________________________
Anthony DESPORTES
Alcatel - Corporate Research Center
Technologies for Networks and Systems
E-Mail : mailto:Anthony.Desportes@ms.alcatel.fr
___________________________________________________