Path: utzoo!utgpu!watmath!att!tut.cis.ohio-state.edu!cs.utexas.edu!milano!cadillac!redcloud!rpj From: rpj@redcloud.cad.mcc.com (Rich Johns) Newsgroups: comp.lang.c++ Subject: to cast or not to cast Message-ID: <1977@cadillac.CAD.MCC.COM> Date: 28 Jul 89 18:17:35 GMT Sender: news@cadillac.CAD.MCC.COM Lines: 35 I just made the change from g++ 1.32 to g++ 1.35.1. I'm discovering that g++ 1.32 was very permissive. For example, 1.32 compiled stuff similar to the following, where as 1.35.1 complains: class Picture : public Graphic { public: int GraphicsContaining(Graphic**&); // other stuff }; class Selection : public Picture { // other stuff }; class PictSelection : public Selection { // right stuff }; inline int PictSelection::SelectionsContaining(Selection**& ss) { return Picture::GraphicsContaining(ss); } G++ 1.35.1 says: bad argument for function `Picture::GraphicsContaining (struct Graphic **&)' (type was struct Selection **) Don't tell me that I have to cast. Selection is a derived from Graphic. Say it aint so. Rich Johns, MCC CAD Program | 3500 W. Balcones Center Dr., Austin, TX 78759 ARPA: johns@mcc.com | Phone: [512] 338-3714 UUCP: {uunet,harvard,gatech,pyramid}!cs.utexas.edu!milano!cadillac!johns