Title
exceptions thrown during iostream cleanup
Status
nad
Section
[ios.init]
Submitter
Martin Sebor

Created on 2003-09-18.00:00:00 last changed 172 months ago

Messages

Date: 2010-10-21.18:28:33

[ 2009-07 Frankfurt ]

Moved to NAD, no consensus for change.

Date: 2010-10-21.18:28:33

[ See 397 and 622 for related issues. ]

Date: 2010-10-21.18:28:33

[ Kona: We probably can't do much better than what we've got, so the LWG is leaning toward NAD. At the point where the standard stream objects are being cleaned up, the usual error reporting mechanism are all unavailable. And exception from flush at this point will definitely cause problems. A quality implementation might reasonably swallow the exception, or call abort, or do something even more drastic. ]

Date: 2003-09-18.00:00:00

The dtor of the ios_base::Init object is supposed to call flush() on the 6 standard iostream objects cout, cerr, clog, wcout, wcerr, and wclog. This call may cause an exception to be thrown.

17.4.4.8, p3 prohibits all library destructors from throwing exceptions.

The question is: What should this dtor do if one or more of these calls to flush() ends up throwing an exception? This can happen quite easily if one of the facets installed in the locale imbued in the iostream object throws.

History
Date User Action Args
2010-10-21 18:28:33adminsetmessages: + msg2556
2010-10-21 18:28:33adminsetmessages: + msg2555
2010-10-21 18:28:33adminsetmessages: + msg2554
2003-09-18 00:00:00admincreate