Title
Unclear description of longjmp undefined behavior
Status
open
Section
21.10.2 [csetjmp.syn]
Submitter
Zhihao Yuan

Created on 2017-10-20.00:00:00, last changed 2017-10-20.00:00:00.

Messages

Date: 2017-10-20.00:00:00

According to 21.10.2 [csetjmp.syn] paragraph 2,

A setjmp/longjmp call pair has undefined behavior if replacing the setjmp and longjmp by catch and throw would invoke any non-trivial destructors for any automatic objects.

The intent is clear, that transferring control from point A to point B via longjmp has undefined behavior if throwing an exception at point A and catching it at point B would invoke non-trivial destructors. The wording could be more precise.

See also the corresponding editorial issue for additional discussion.

History
Date User Action Args
2017-10-20 00:00:00admincreate