From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32207 invoked by alias); 20 Sep 2002 20:16:03 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 32164 invoked by uid 71); 20 Sep 2002 20:16:02 -0000 Resent-Date: 20 Sep 2002 20:16:02 -0000 Resent-Message-ID: <20020920201602.32163.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, nospam@mackman.net Received: (qmail 29025 invoked by uid 61); 20 Sep 2002 20:09:34 -0000 Message-Id: <20020920200934.29024.qmail@sources.redhat.com> Date: Fri, 20 Sep 2002 13:16:00 -0000 From: nospam@mackman.net Reply-To: nospam@mackman.net To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/7991: Exception in destructor gets caught twice X-SW-Source: 2002-09/txt/msg00601.txt.bz2 List-Id: >Number: 7991 >Category: c++ >Synopsis: Exception in destructor gets caught twice >Confidential: no >Severity: non-critical >Priority: low >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Fri Sep 20 13:16:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Ryan Mack >Release: gcc-3.2 >Organization: >Environment: RH 7.3, cygwin >Description: It seems that even though the exception is caught in the destructor, it gets caught again when exiting the catch block. >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: text/plain; name="foo.cpp" Content-Disposition: inline; filename="foo.cpp" #include struct A { ~A() { throw 1; } }; struct B { A a; ~B() try { } catch (int i) { std::cerr << "caught exception in ~B: " << i << std::endl; } }; int main(int argc, char** argv) { try { B b; } catch (int i) { std::cerr << "caught exception in main: " << i << std::endl; } return 0; }