This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
maybe GCC C++ bug in namespace handling?
- From: Dirk Mueller <dmuell at gmx dot net>
- To: gcc at gcc dot gnu dot org
- Date: Mon, 11 Feb 2002 21:47:40 +0100
- Subject: maybe GCC C++ bug in namespace handling?
Hi,
I've found an incompatibility in the namespace handling between gcc and
non-gcc compilers, and I am not sure which one is right..
Given this sample snippet:
.......................................................................
namespace ns {
class base {
public:
virtual ~base() {};
virtual void foo() {};
};
}
class derived : public ns::base {
public:
virtual void foo();
};
void derived::foo()
{
base::foo(); // or ns::base::foo ?
}
int main()
{
derived d;
d.foo();
return 0;
}
.......................................................................
and the line with the comment. which of the statements is correct ?
gcc groks both without a warning or an error, while other compilers only
accept the second variant.
I'm undecided about the correct behaviour. Can anyone please shed a light on
this ?
Dirk