public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jason at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/15097] code generator problem with ::delete and multiple inheritance and virtual deconstructs
Date: Wed, 05 Sep 2007 16:08:00 -0000	[thread overview]
Message-ID: <20070905160831.26639.qmail@sourceware.org> (raw)
In-Reply-To: <bug-15097-7154@http.gcc.gnu.org/bugzilla/>



------- Comment #4 from jason at gcc dot gnu dot org  2007-09-05 16:08 -------
The reduced testcase breaks in the same way with ICC 10.0.023 if I add a
user-defined operator delete to B2.  If I add it to D instead, ICC incorrectly
calls the user-defined delete instead of the global delete in the calls to f2
and f3.

This seems to be a standards and/or ABI problem.  The standard clearly states
that the global delete will be used if you say ::delete, but the C++ ABI
doesn't provide any mechanism for that.  EDG seem to be trying to split the
difference by using the deleting destructor if the static type doesn't have an
operator delete, but that's wrong if the dynamic type of the object does.

It seems that the solution would be to return the true address as void* from a
virtual destructor, or add another deleting destructor that uses the global
operator delete.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15097


       reply	other threads:[~2007-09-05 16:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-15097-7154@http.gcc.gnu.org/bugzilla/>
2007-09-05 16:08 ` jason at gcc dot gnu dot org [this message]
2007-09-06  1:25 ` jason at gcc dot gnu dot org
2007-09-13 16:04 ` jason at gcc dot gnu dot org
2009-02-05 20:05 ` pinskia at gcc dot gnu dot org
     [not found] <20040423110112.15097.wolfgang.roehrl@gi-de.com>
2005-08-20  4:33 ` pinskia at gcc dot gnu dot org
2004-04-23 11:05 [Bug c++/15097] New: code generator problem with ::delete and multiple inheritance wolfgang dot roehrl at de dot gi-de dot com
2004-04-23 13:26 ` [Bug c++/15097] code generator problem with ::delete and multiple inheritance and virtual deconstructs pinskia at gcc dot gnu dot org
2004-05-04 19:30 ` pinskia at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070905160831.26639.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).