Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!fernwood!lia!steve From: steve@lia (Stephen Williams) Newsgroups: comp.lang.c++ Subject: Bug in multiple inheritence Summary: Caste reference to derived class to a base class breaks. Message-ID: <1991Jan11.193846.12505@lia> Date: 11 Jan 91 19:38:46 GMT References: <1991Jan7.153341.29504@slcs.slb.com> Reply-To: steve@lia.com (Stephen Williams) Organization: Litton/Integrated Automation, Alameda, California Lines: 25 The following program demonstrates an apparent bug in C++ 2.0 and 2.1. Am I seeing things? class X { int x, y; }; class Y { int a, b; }; class Mess : public X, public Y { int m; }; main() { Mess m; Mess &n = m; X x = n; Y y = n; // <---- C++ Error!!!! In this case y should get the // Y part of n, but is instead getting the X part. // An offset is missing. X &xp = n; Y &yp = n; // <---- Works. In this case the correct code // is generated. }