From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28868 invoked by alias); 4 Feb 2003 01:06:01 -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 28849 invoked by uid 71); 4 Feb 2003 01:06:00 -0000 Resent-Date: 4 Feb 2003 01:06:00 -0000 Resent-Message-ID: <20030204010600.28848.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 28802 invoked by uid 48); 4 Feb 2003 01:05:29 -0000 Message-Id: <20030204010529.28801.qmail@sources.redhat.com> Date: Tue, 04 Feb 2003 01:06: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: libstdc++/9561: ostream inserters rethrow exception of wrong type X-SW-Source: 2003-02/txt/msg00167.txt.bz2 List-Id: >Number: 9561 >Category: libstdc++ >Synopsis: ostream inserters rethrow exception of wrong type >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Tue Feb 04 01:06:00 UTC 2003 >Closed-Date: >Last-Modified: >Originator: sebor@roguewave.com >Release: 3.2.1 >Organization: >Environment: >Description: The program below is expected to exit with the status of 0 but when compiled with gcc/libstdc++ 3.2.1 it exits with 2, indicating that the inserter throws an exception of the wrong type instead of the one thrown from overflow. Regards Martin >How-To-Repeat: #include #include struct foobar: std::exception { }; struct buf: std::streambuf { virtual int_type overflow (int_type) { throw foobar (); return -1; } }; int main () { buf b; std::ostream strm (&b); strm.exceptions (std::ios::badbit); try { strm << std::endl; } catch (foobar) { return !(strm.bad ()); } catch (...) { return 2; } return 3; } >Fix: >Release-Note: >Audit-Trail: >Unformatted: