This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
RE: libstdc++/10093: Regression: Setting failbit in exceptions doesn't work
- From: Pétur Runólfsson <peturr02 at ru dot is>
- To: "Jerry Quinn" <jlquinn at optonline dot net>,"Martin Sebor" <sebor at roguewave dot com>
- Cc: <libstdc++ at gcc dot gnu dot org>
- Date: Thu, 3 Apr 2003 15:20:04 -0000
- Subject: RE: libstdc++/10093: Regression: Setting failbit in exceptions doesn't work
Jerry Quinn wrote:
> The bug filed was about the fact that if ios::failbit is set in the
> exception mask and we throw an error, it doesn't get rethrown. So the
> question is what other conditions should result in rethrowing the
> exception.
I don't think there is any question about that; caught exceptions
get rethrown if and only if (exceptions() & badbit) (for most
functions).
> Also, are you and Petur saying that we should just have a catch() that
> catches everything? I guess we then use rtti before deciding if it of
> class exception and whether to rethrow or not.
I don't think the behaviour should depend in any way on the type
of the exception; that is, the catch block should be "as if":
try {
// Some stuff
} catch (...) {
try { setstate(badbit); } catch (...) { }
if (exceptions() & badbit) throw;
}
The question (as I see it) is what goes in the try block; opinions
seem to differ.
At this point, I think the best strategy is to wait a couple of
weeks and see any of the relevant defect reports get resolved.
Regards,
Petur