From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24770 invoked by alias); 10 Mar 2004 15:23:05 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 24763 invoked from network); 10 Mar 2004 15:23:04 -0000 Received: from unknown (HELO hqsvc03.solipsys.com) (209.117.190.85) by sources.redhat.com with SMTP; 10 Mar 2004 15:23:04 -0000 Received: from Unknown [10.0.2.91] by hqsvc03.solipsys.com - SurfControl E-mail Filter (4.7); Wed, 10 Mar 2004 10:23:02 -0500 Message-ID: <005401c406b3$93ecd160$5b02000a@solipsys.com> From: "Tony Wetmore" To: "'Eljay Love-Jensen'" , "'Assinovsky, Lev'" , Date: Wed, 10 Mar 2004 15:57:00 -0000 Subject: RE: Great g++ bug! Local destructor isn't called! MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit In-Reply-To: <6.0.3.0.2.20040310084202.01f41830@iplan-mn.corp.adobe.com> X-SW-Source: 2004-03/txt/msg00095.txt.bz2 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