3871. Adjust note about terminate

Section: 16.4.2.5 [compliance] Status: C++23 Submitter: CA Opened: 2023-02-01 Last modified: 2023-11-22

Priority: Not Prioritized

View all other issues in [compliance].

View all issues with C++23 status.

Discussion:

This is the resolution for NB comment CA-076

16.4.2.5 [compliance] p4 has this note:

[Note 1: Throwing a standard library provided exception is not observably different from terminate() if the implementation does not unwind the stack during exception handling (14.4 [except.handle]) and the user's program contains no catch blocks. — end note]

Even under the conditions described by the note, a call to terminate() is observably different from throwing an exception if the current terminate_handler function observes what would have been the currently handled exception in the case where the exception was thrown.

The set of conditions should be extended to include something along the lines of "and the current terminate_handler function simply calls abort()".

Previous resolution [SUPERSEDED]:

This wording is relative to N4928.

  1. Modify 16.4.2.5 [compliance], "Freestanding implementations", as indicated:

    -4- [Note 1: Throwing a standard library provided exception is not observably different from terminate() if the implementation does not unwind the stack during exception handling (14.4 [except.handle]) and the user's program contains no catch blocks and the current terminate_handler function simply calls abort(). — end note]

[Issaquah 2023-02-06; LWG]

If the note isn't true then remove it.
Poll: keep note and change as proposed? 3/1/10.
Poll: drop the note entirely? 10/0/5.
Drop the note and move to Immediate for C++20: 9/0/2.

[2023-02-13 Approved at February 2023 meeting in Issaquah. Status changed: Immediate → WP.]

Proposed resolution:

This wording is relative to N4928.

  1. Modify 16.4.2.5 [compliance], "Freestanding implementations", as indicated:

    -4- [Note 1: Throwing a standard library provided exception is not observably different from terminate() if the implementation does not unwind the stack during exception handling (14.4 [except.handle]) and the user's program contains no catch blocks. — end note]