A
Alexander Grigoriev
I've got a problem with GNU C++ for ARM, which is used in WindRiver Tornado
2.11 environment.
I tried the following construct:
void foo();
namespace N
{
class C
{
friend void ::foo();
};
}
GCC does not accept namespace resolution in the friend function declaration.
MS Visual C compiler is happy with it, though.
ANSI C++ standard allows fully qualified name in friend declaration when
referring to a member function of another class, but doesn't say anything
about referring to a nonmember function from another namespace. I believe
it's just oversight, because there doesn't seem any syntactic and semantic
ambiguity with that.
2.11 environment.
I tried the following construct:
void foo();
namespace N
{
class C
{
friend void ::foo();
};
}
GCC does not accept namespace resolution in the friend function declaration.
MS Visual C compiler is happy with it, though.
ANSI C++ standard allows fully qualified name in friend declaration when
referring to a member function of another class, but doesn't say anything
about referring to a nonmember function from another namespace. I believe
it's just oversight, because there doesn't seem any syntactic and semantic
ambiguity with that.