This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: namespace lookup bug
- To: paul at pajato dot com
- Subject: Re: namespace lookup bug
- From: "Martin v. Loewis" <martin at mira dot isdn dot cs dot tu-berlin dot de>
- Date: Sat, 14 Aug 1999 12:19:38 +0200
- CC: gcc-bugs at gcc dot gnu dot org, tromey at cygnus dot com
- References: <199908140815.EAA12109@gsxr.pajato.com>
> I've been led to be believe that having two namespaces with the same
> name, nested at different points in namespace tree should work, but I
> can't seem to get it to compile.
It does work, apparently just not the way you have been led to
believe.
> class C::A::ClassB : public A::B::ClassA
With 'class C::A::ClassB', you re-open namespace ::C::A::. Here, the
name A::B::ClassA must be resolved. A resolves to ::C::A, and then you
get
> ClassB.cc:23: `B' is not a class or namespace
To fix this, write
class C::A::ClassB : public ::A::B::ClassA
Hope this helps,
Martin