libstdc++/10093: Regression: Setting failbit in exceptions doesn't work

Jerry Quinn jlquinn@optonline.net
Sun Mar 23 17:01:00 GMT 2003


I'm a bit confused by this bug.  What should the behavior be here?  To my
simple reading of the standard, it seems that the code is operating correctly.

The test case is designed to throw if failbit is set.  Failbit does get set,
which causes the exception to be thrown.  However, it is caught in the
exception handler and not rethrown.

27.6.1.2.1 says that the exception is rethrown if badbit is set in the
exception mask (and badbit is set), otherwise not.  This makes it sound like
the _only_ way to get an exception from the formatted input functions is to
set badbit in the exception mask.

Petur, can you explain what I'm missing?

Thanks
Jerry Quinn



More information about the Gcc-bugs mailing list