public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Tony Wetmore" <tony.wetmore@solipsys.com>
To: "'Eljay Love-Jensen'" <eljay@adobe.com>,
	"'Assinovsky, Lev'" <LAssinovsky@algorithm.aelita.com>,
	<gcc-help@gcc.gnu.org>
Subject: RE: Great g++ bug! Local destructor isn't called!
Date: Wed, 10 Mar 2004 15:57:00 -0000	[thread overview]
Message-ID: <005401c406b3$93ecd160$5b02000a@solipsys.com> (raw)
In-Reply-To: <6.0.3.0.2.20040310084202.01f41830@iplan-mn.corp.adobe.com>

Interestingly, ~Object() is also called if you ADD a "throw(int)"
specifier to the FromBase::Run() method that invokes the Raiser
constructor.  Tested on Linux with GCC 3.3.1.

---
Tony Wetmore
Raytheon Solipsys
mailto:tony.wetmore@solipsys.com
http://www.solipsys.com
 
 


-----Original Message-----
From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On
Behalf Of Eljay Love-Jensen
Sent: Wednesday, March 10, 2004 9:46 AM
To: Assinovsky, Lev; gcc-help@gcc.gnu.org
Subject: Re: Great g++ bug! Local destructor isn't called!


Hi Lev,

I notice that if the throw(int) specification is taken off the Raiser 
constructor, then the ~Object() is called with -O3.

(I'm using GCC 3.3.1 on CygWin / Windows XP.)

Very odd.  Good catch.  Have you filed a bug?

BTW, in general, I've found that it's usually best NOT to put in throw 
specifications for functions / methods.  Ever.  (This restriction does
not 
apply to putting in the "throw() -- I throw nothing, ever" 
specification.  But even that should be used with great caution.)

If C++ did exception specifications like how Java does them, then that'd
be 
a different story.

--Eljay


  reply	other threads:[~2004-03-10 15:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-10 14:52 Assinovsky, Lev
2004-03-10 15:23 ` Eljay Love-Jensen
2004-03-10 15:57   ` Tony Wetmore [this message]
2004-03-10 15:38 Assinovsky, Lev
2004-03-10 15:59 Assinovsky, Lev
2004-03-10 16:02 Moore, Mathew L
2004-03-10 16:49 ` Momchil Velikov
2004-03-10 18:34 Eljay Love-Jensen
2004-03-10 19:49 Martin York
2004-03-11 18:20 Assinovsky, Lev
2004-03-11 21:37 Assinovsky, Lev

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='005401c406b3$93ecd160$5b02000a@solipsys.com' \
    --to=tony.wetmore@solipsys.com \
    --cc=LAssinovsky@algorithm.aelita.com \
    --cc=eljay@adobe.com \
    --cc=gcc-help@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).