This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: abstract base classes & MI
- To: ckerr at enterprise dot nssl dot noaa dot gov, egcs-bugs at egcs dot cygnus dot com, egcs at egcs dot cygnus dot com
- Subject: Re: abstract base classes & MI
- From: mrs at wrs dot com (Mike Stump)
- Date: Fri, 19 Feb 1999 16:35:06 -0800
> Date: Fri, 19 Feb 1999 16:03:56 -0600
> From: Charles Kerr <ckerr@enterprise.nssl.noaa.gov>
> To: egcs@egcs.cygnus.com, egcs-bugs@egcs.cygnus.com
> Using egcs-2.93.06 (the 1999/02/08 snapshot), the code:
> struct A_interface {
> virtual void foo ( ) = 0;
> };
> struct A_impl {
> virtual void foo ( );
> };
> struct B_interface: public A_interface {
> virtual void bar ( ) = 0;
> };
> struct B_impl : public A_impl, public B_interface {
> virtual void bar ( );
> };
> struct C: public B_impl {
> void asdf ( ) {
> foo ( );
> }
> };
> yields the error:
> Foo.C: In method `void C::asdf()':
> Foo.C:15: request for member `foo' is ambiguous in multiple inheritance lattice
> I don't see the ambiguity.
Let me explan on what others have said some...
Which subobject did you want the virtual foo valled with? A_impl or
a_interface? How does the code indicate that? (It doesn't.) Put in
a virtual base for A_impl and A_interface and link A_impl to
A_interface and it'll work as written.