From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26623 invoked by alias); 2 May 2003 21:26:00 -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 26602 invoked by uid 71); 2 May 2003 21:26:00 -0000 Resent-Date: 2 May 2003 21:26:00 -0000 Resent-Message-ID: <20030502212600.26601.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, sebor@roguewave.com Received: (qmail 26411 invoked by uid 48); 2 May 2003 21:25:20 -0000 Message-Id: <20030502212520.26409.qmail@sources.redhat.com> Date: Fri, 02 May 2003 21:26:00 -0000 From: sebor@roguewave.com Reply-To: sebor@roguewave.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/10606: uncaught_exception() returns false too early X-SW-Source: 2003-05/txt/msg00156.txt.bz2 List-Id: >Number: 10606 >Category: c++ >Synopsis: uncaught_exception() returns false too early >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Fri May 02 21:26:00 UTC 2003 >Closed-Date: >Last-Modified: >Originator: sebor@roguewave.com >Release: 3.2 >Organization: >Environment: >Description: The program below shows that the gcc implementation of uncaught_exception() violates 15.5.3, p1. Specifically, the function is required to return true "until completing the initialization of the exception-declaration in the matching handler" which the gcc impletation fails to do (the output line marked <<<). Martin >How-To-Repeat: $ cat t.cpp; g++ t.cpp && ./a.out #include #include int main () { #define SHOW(fun) \ printf ("%s(%d): %s: uncaught_exception() = %d\n", \ __FILE__, __LINE__, fun, std::uncaught_exception ()) struct S { S () { SHOW ("S::S()"); } S (const S &s) { SHOW ("S::S(const S&)"); } ~S () { SHOW ("S::~S()"); } }; try { S s; throw s; } catch (S s) { SHOW ("catch"); } } t.cpp(11): S::S(): uncaught_exception() = 0 t.cpp(12): S::S(const S&): uncaught_exception() = 0 t.cpp(13): S::~S(): uncaught_exception() = 1 t.cpp(12): S::S(const S&): uncaught_exception() = 0 <<< t.cpp(21): catch: uncaught_exception() = 0 t.cpp(13): S::~S(): uncaught_exception() = 0 t.cpp(13): S::~S(): uncaught_exception() = 0 >Fix: >Release-Note: >Audit-Trail: >Unformatted: