[gnu.g++] multiple inheritance

strick@gatech.edu (henry strickland) (03/23/89)

The rumour went around Georgia Tech that the newest GNU g++ handled
multiple inheritance.    Where did that rumour come from?

I got "g++-1.34.1.tar.Z" from "prep.ai.mit.edu".   I use a sun3.

Is there even a schetchy list of what is supposed to work in this
distribution?  Am I overlooking some documentation file?
g++.texinfo documents many things well, but seems out of date.
For instance, people on the net are discussing special return variables,
which are not in g++.texinfo.  How did they find out about these?
Multiple inheritance isn't mentioned either.

What I can intuit from testing and looking at the sources,
multiple inheritance works only in the following special case:
	-- nothing is virtual.
	-- variables of superclasses are not accessed directly.
			(i.e., you use member functions only to
				access your supers).
Is this right?  Supposed to work?       TIA,

					Henry Strickland
					<strick@gatech.edu>

tiemann@YAHI.STANFORD.EDU (Michael Tiemann) (05/14/89)

You have to be a little more careful when diagnosing MI problems.
Doug Schmidt's posing is preceded by '>'.  Daniel's is preceded by '+'

   >  class a {
   >  public:
   >    int foo () { printf ("foo\n"); }
   >  };
   >  class b : public a {
   >  private:
   >    a::foo; // made private for all classes derived from class b.
   >  };
     
   >  class c : public a {
   >  public:
   >    c () {printf ("c\n");}
   >  };
     
   >  class d : public c, public b {
   >  public:
   >                    // both public *and* private!! which prevails?
   >    d () { printf ("d\n"); foo (); } 
   >  };
   
   ++ My understanding is that if the call is ambiguous it's a
   ++ syntax error. That might not apply in this case since this is 
   ++ the same function being inherited along two different paths of 
   ++ the DAG.
Since this is a case of `independent' multiple inheritance, `foo' is
provided by independent baseclasses, namely c::a::foo and b::a::foo.
GNU C++ observes that as an ambiguity, independent of the visibility
issue, and trudges on.

Michael

sho@JUPITER.RISC.COM (Sho Kuwamoto) (07/22/89)

Can anyone enlighten me on the syntax of multiple inheritance?  We do not get
news here, so I can't read comp.lang.c++....

How well is does it work in g++ 1.35.0(the one we're using)?  
What about 1.35.1?

-Sho