This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/6322: Multiple inheritance structure causes segfault on delete.
- From: nathan at gcc dot gnu dot org
- To: gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, xternal at centibyte dot org
- Date: 25 Apr 2002 14:19:35 -0000
- Subject: Re: c++/6322: Multiple inheritance structure causes segfault on delete.
- Reply-to: nathan at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, xternal at centibyte dot org, gcc-gnats at gcc dot gnu dot org
Synopsis: Multiple inheritance structure causes segfault on delete.
State-Changed-From-To: open->closed
State-Changed-By: nathan
State-Changed-When: Thu Apr 25 07:19:33 2002
State-Changed-Why:
not a bug. your code is ill-formed.
you are attempting to delete a derived object using a
pointer to one of its bases. Refer to [5.3.5].
In particular, if the static type of the object (base in
your case) is different to the dynamic type (derived),
the static type shall be a base of the dynamic type (ok),
and the static type shall have a virtual destructor, otherwise
the behaviour is undefined.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6322