2497. Use of uncaught_exception()

Section: 30.7.5.1.3 [ostream::sentry] Status: New Submitter: Roger Orr Opened: 2015-05-08 Last modified: 2017-02-02

Priority: 3

View all other issues in [ostream::sentry].

View all issues with New status.

Discussion:

In the current 30.7.5.1.3 [ostream::sentry], p4 refers to the now deprecated std::uncaught_exception(): D.9 [depr.uncaught].

If ((os.flags() & ios_base::unitbuf) && !uncaught_exception() && os.good()) is true, calls os.rdbuf()->pubsync().

This needs to be changed, for example to use std::uncaught_exceptions() and to capture the value on entry and compare with the saved value on exit.

[2015-06, Telecon]

JW: I already added an 's' here to make it use the new function, but that doesn't resolve Roger's suggestion to capture the value on entry and check it.

Proposed resolution: