894. longjmp and destructors

Section: 17.13 [support.runtime] Status: C++11 Submitter: Lawrence Crowl, Alisdair Meredith Opened: 2008-09-17 Last modified: 2016-01-28 10:19:27 UTC

Priority: Not Prioritized

View all other issues in [support.runtime].

View all issues with C++11 status.

Discussion:

The interaction between longjmp and exceptions seems unnecessarily restrictive and not in keeping with existing practice.

Proposed resolution:

Edit paragraph 4 of 17.13 [support.runtime] as follows:

The function signature longjmp(jmp_buf jbuf, int val) has more restricted behavior in this International Standard. A setjmp/longjmp call pair has undefined behavior if replacing the setjmp and longjmp by catch and throw would destroy invoke any non-trivial destructors for any automatic objects.