Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!YAHI.STANFORD.EDU!tiemann From: tiemann@YAHI.STANFORD.EDU (Michael Tiemann) Newsgroups: gnu.g++ Subject: multiple inheritance Message-ID: <8905140623.AA22716@yahi.stanford.edu> Date: 14 May 89 06:23:59 GMT References: <7105@saturn.ucsc.edu> Sender: daemon@tut.cis.ohio-state.edu Reply-To: tiemann@lurch.stanford.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 33 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