From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31192 invoked by alias); 3 Feb 2003 20:26: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 31173 invoked by uid 71); 3 Feb 2003 20:26:01 -0000 Resent-Date: 3 Feb 2003 20:26:01 -0000 Resent-Message-ID: <20030203202601.31172.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 20737 invoked by uid 48); 3 Feb 2003 20:18:20 -0000 Message-Id: <20030203201820.20736.qmail@sources.redhat.com> Date: Mon, 03 Feb 2003 20: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: libstdc++/9555: ostream inserters fail to set badbit on exception X-SW-Source: 2003-02/txt/msg00146.txt.bz2 List-Id: >Number: 9555 >Category: libstdc++ >Synopsis: ostream inserters fail to set badbit on exception >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Mon Feb 03 20:26:01 UTC 2003 >Closed-Date: >Last-Modified: >Originator: sebor@roguewave.com >Release: 3.2.1 >Organization: >Environment: >Description: The expected exit status of the program below is 0. When compiled with gcc 3.2.1 and the supplied libstdc++, it is 1, indicating that the inserter fails to set badbit when an exception occurs during output. Regards Martin >How-To-Repeat: #include #include struct buf: std::streambuf { virtual int_type overflow (int_type) { throw 0; return -1; } }; int main () { buf b; std::ostream strm (&b); strm.exceptions (std::ios::badbit); try { strm << 0; } catch (int) { return !(strm.bad ()); } catch (...) { return 2; } return 3; } >Fix: >Release-Note: >Audit-Trail: >Unformatted: