Bug 9370 - Bad exception handling in formatted I/O functions
Summary: Bad exception handling in formatted I/O functions
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libstdc++ (show other bugs)
Version: 3.2.1
: P3 normal
Target Milestone: 3.3
Assignee: Benjamin Kosnik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-01-20 09:56 UTC by Pétur Runólfsson
Modified: 2003-12-17 20:49 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2003-05-23 05:32:37


Attachments
exceptionsbug.cc (574 bytes, text/plain)
2003-05-21 15:17 UTC, Pétur Runólfsson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pétur Runólfsson 2003-01-20 09:56:00 UTC
Exception handling in the formatted I/O functions (istream::operator>> and ostream::operator<<) appears to be broken.

1. Exceptions derived from std::exception are handled correctly, except that the original exception isn't rethrown if badbit is set in exceptions(), an ios_base::failure is thrown instead.

2. Exceptions not derived from std::exception are not handled at all, badbit is not set in rdstate() and the exception is passed on to the caller even if badbit is not set in exceptions().

Release:
gcc-3.2.1

Environment:
Red Hat Linux 8.0

How-To-Repeat:
See attachment.
Comment 1 Pétur Runólfsson 2003-07-02 15:49:42 UTC
It seems this bug has been fixed, at least the test case now runs as expected.
Comment 2 Andrew Pinski 2003-08-07 13:10:50 UTC
All tests pass on the mainline so closing as fixed.