Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!decwrl!ucbvax!pasteur!ames!haven!uvaarpa!mcnc!rti!xyzzy!bert!coleman From: coleman@bert.dg.com (Kim Coleman) Newsgroups: comp.lang.c++ Subject: cfront inheritance problem Summary: Is this a bug or not? Keywords: virtual functions Message-ID: <4612@xyzzy.UUCP> Date: 28 Mar 89 18:31:58 GMT Sender: usenet@xyzzy.UUCP Reply-To: coleman@bert.dg.com (Kim Coleman) Distribution: usa Organization: Data General Corporation, Research Triangle Park, NC. Lines: 42 On the program below, cfront insists that there is a type mismatch between virtual function Object::some_method and Collection::some_method. I can't quite decide if this is a bug or not. It certainly SEEMS like a bug, but I'm willing to be enlightened if it's just a gap in my understanding. I can see a case against the implicit conversion of Object& to Collection_Member& on the basis of Stroustrap only stating there is an implicit conversion between base and derived pointers. However, cfront doesn't seem to want to make an implicit conversion between Object* and Collection_Member*, either. class Object { public: virtual Object* some_method (const Object&); }; class Collection_Member : public Object {}; class Collection : public Object { public: // this is what I WANT to do Collection_Member* some_method (const Collection_Member&); // // in desparation, I also tried: // // g++ 1.34.1 accepts this form // Collection_Member* some_method (const Object&); // Object* some_method (const Collection_Member&); // cfront only accepts this form // Object* some_method (const Object&); }; ---------------------------- Kim Coleman Data General Corp., Research Triangle Park, NC {the world}!mcnc!rti!dg-rtp!coleman