[comp.lang.c++] to cast or not to cast

rpj@redcloud.cad.mcc.com (Rich Johns) (07/29/89)

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