[comp.lang.c++] bug in virtual dtor / subclass with mem of type superclass

eppstein@garfield.columbia.edu (David Eppstein) (02/14/88)

The following code gives me a horrible error (bus error) when C++ tries
to process the dtor definition.  The workaround is obvious (make sub a
pointer) but I wanted to do it this way...  I think we're still running
1.1; does this still happen in later versions?
            ------------
class a {
    a();
    virtual ~a();
};

class b : public a {
    a sub;
    b();
    ~b();
};

b::~b() { ; }
-- 
David Eppstein   eppstein@garfield.columbia.edu   Columbia U. Computer Science