This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]