tmp/tmp17jnz_0z/{from.md → to.md}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
### The `std::terminate` function <a id="except.terminate">[[except.terminate]]</a>
|
| 2 |
|
| 3 |
-
In some situations exception handling
|
| 4 |
-
|
| 5 |
|
| 6 |
[*Note 1*:
|
| 7 |
|
| 8 |
These situations are:
|
| 9 |
|
|
@@ -16,11 +16,11 @@ These situations are:
|
|
| 16 |
- when the search for a handler [[except.handle]] encounters the
|
| 17 |
outermost block of a function with a non-throwing exception
|
| 18 |
specification [[except.spec]], or
|
| 19 |
- when the destruction of an object during stack unwinding
|
| 20 |
[[except.ctor]] terminates by throwing an exception, or
|
| 21 |
-
- when initialization of a non-
|
| 22 |
storage duration [[basic.start.dynamic]] exits via an exception, or
|
| 23 |
- when destruction of an object with static or thread storage duration
|
| 24 |
exits via an exception [[basic.start.term]], or
|
| 25 |
- when execution of a function registered with `std::atexit` or
|
| 26 |
`std::at_quick_exit` exits via an exception [[support.start.term]], or
|
|
@@ -30,32 +30,33 @@ These situations are:
|
|
| 30 |
- when the function `std::nested_exception::rethrow_nested` is called
|
| 31 |
for an object that has captured no exception [[except.nested]], or
|
| 32 |
- when execution of the initial function of a thread exits via an
|
| 33 |
exception [[thread.thread.constr]], or
|
| 34 |
- for a parallel algorithm whose `ExecutionPolicy` specifies such
|
| 35 |
-
behavior
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
- when the destructor or the move assignment operator is invoked on an
|
| 40 |
-
object of type `std::thread` that refers to a joinable thread
|
| 41 |
-
[[thread.thread.destr]], [[thread.thread.assign]]
|
| 42 |
- when a call to a `wait()`, `wait_until()`, or `wait_for()` function on
|
| 43 |
-
a condition variable
|
| 44 |
-
[[thread.condition.condvarany]]
|
|
|
|
| 45 |
|
| 46 |
— *end note*]
|
| 47 |
|
| 48 |
-
In such cases, the function `std::terminate` is
|
| 49 |
[[exception.terminate]]. In the situation where no matching handler is
|
| 50 |
found, it is *implementation-defined* whether or not the stack is
|
| 51 |
-
unwound before `std::terminate` is
|
| 52 |
search for a handler [[except.handle]] encounters the outermost block of
|
| 53 |
a function with a non-throwing exception specification [[except.spec]],
|
| 54 |
it is *implementation-defined* whether the stack is unwound, unwound
|
| 55 |
partially, or not unwound at all before the function `std::terminate` is
|
| 56 |
-
|
| 57 |
-
the function `std::terminate` is
|
| 58 |
permitted to finish stack unwinding prematurely based on a determination
|
| 59 |
-
that the unwind process will eventually cause
|
| 60 |
-
`std::terminate`.
|
| 61 |
|
|
|
|
| 1 |
### The `std::terminate` function <a id="except.terminate">[[except.terminate]]</a>
|
| 2 |
|
| 3 |
+
In some situations exception handling is abandoned for less subtle error
|
| 4 |
+
handling techniques.
|
| 5 |
|
| 6 |
[*Note 1*:
|
| 7 |
|
| 8 |
These situations are:
|
| 9 |
|
|
|
|
| 16 |
- when the search for a handler [[except.handle]] encounters the
|
| 17 |
outermost block of a function with a non-throwing exception
|
| 18 |
specification [[except.spec]], or
|
| 19 |
- when the destruction of an object during stack unwinding
|
| 20 |
[[except.ctor]] terminates by throwing an exception, or
|
| 21 |
+
- when initialization of a non-block variable with static or thread
|
| 22 |
storage duration [[basic.start.dynamic]] exits via an exception, or
|
| 23 |
- when destruction of an object with static or thread storage duration
|
| 24 |
exits via an exception [[basic.start.term]], or
|
| 25 |
- when execution of a function registered with `std::atexit` or
|
| 26 |
`std::at_quick_exit` exits via an exception [[support.start.term]], or
|
|
|
|
| 30 |
- when the function `std::nested_exception::rethrow_nested` is called
|
| 31 |
for an object that has captured no exception [[except.nested]], or
|
| 32 |
- when execution of the initial function of a thread exits via an
|
| 33 |
exception [[thread.thread.constr]], or
|
| 34 |
- for a parallel algorithm whose `ExecutionPolicy` specifies such
|
| 35 |
+
behavior [[execpol.seq]], [[execpol.par]], [[execpol.parunseq]], when
|
| 36 |
+
execution of an element access function [[algorithms.parallel.defns]]
|
| 37 |
+
of the parallel algorithm exits via an exception
|
| 38 |
+
[[algorithms.parallel.exceptions]], or
|
| 39 |
- when the destructor or the move assignment operator is invoked on an
|
| 40 |
+
object of type `std::thread` that refers to a joinable thread
|
| 41 |
+
[[thread.thread.destr]], [[thread.thread.assign]], or
|
| 42 |
- when a call to a `wait()`, `wait_until()`, or `wait_for()` function on
|
| 43 |
+
a condition variable
|
| 44 |
+
[[thread.condition.condvar]], [[thread.condition.condvarany]] fails to
|
| 45 |
+
meet a postcondition.
|
| 46 |
|
| 47 |
— *end note*]
|
| 48 |
|
| 49 |
+
In such cases, the function `std::terminate` is invoked
|
| 50 |
[[exception.terminate]]. In the situation where no matching handler is
|
| 51 |
found, it is *implementation-defined* whether or not the stack is
|
| 52 |
+
unwound before `std::terminate` is invoked. In the situation where the
|
| 53 |
search for a handler [[except.handle]] encounters the outermost block of
|
| 54 |
a function with a non-throwing exception specification [[except.spec]],
|
| 55 |
it is *implementation-defined* whether the stack is unwound, unwound
|
| 56 |
partially, or not unwound at all before the function `std::terminate` is
|
| 57 |
+
invoked. In all other situations, the stack shall not be unwound before
|
| 58 |
+
the function `std::terminate` is invoked. An implementation is not
|
| 59 |
permitted to finish stack unwinding prematurely based on a determination
|
| 60 |
+
that the unwind process will eventually cause an invocation of the
|
| 61 |
+
function `std::terminate`.
|
| 62 |
|