From Jason Turner

[except.terminate]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmprzrg5_6d/{from.md → to.md} +29 -21
tmp/tmprzrg5_6d/{from.md → to.md} RENAMED
@@ -1,53 +1,61 @@
1
  ### The `std::terminate()` function <a id="except.terminate">[[except.terminate]]</a>
2
 
3
  In some situations exception handling must be abandoned for less subtle
4
- error handling techniques. These situations are:
 
 
 
 
5
 
6
  - when the exception handling mechanism, after completing the
7
  initialization of the exception object but before activation of a
8
  handler for the exception ([[except.throw]]), calls a function that
9
  exits via an exception, or
10
  - when the exception handling mechanism cannot find a handler for a
11
  thrown exception ([[except.handle]]), or
12
  - when the search for a handler ([[except.handle]]) encounters the
13
- outermost block of a function with a *noexcept-specification* that
14
- does not allow the exception ([[except.spec]]), or
15
  - when the destruction of an object during stack unwinding (
16
  [[except.ctor]]) terminates by throwing an exception, or
17
  - when initialization of a non-local variable with static or thread
18
- storage duration ([[basic.start.init]]) exits via an exception, or
19
  - when destruction of an object with static or thread storage duration
20
  exits via an exception ([[basic.start.term]]), or
21
  - when execution of a function registered with `std::atexit` or
22
  `std::at_quick_exit` exits via an exception ([[support.start.term]]),
23
  or
24
- - when a *throw-expression* with no operand attempts to rethrow an
25
- exception and no exception is being handled ([[except.throw]]), or
26
- - when `std::unexpected` throws an exception which is not allowed by the
27
- previously violated *dynamic-exception-specification*, and
28
- `std::bad_exception` is not included in that
29
- *dynamic-exception-specifica{-}tion* ([[except.unexpected]]), or
30
- - when the implementation’s default unexpected exception handler is
31
- called ([[unexpected.handler]]), or
32
  - when the function `std::nested_exception::rethrow_nested` is called
33
  for an object that has captured no exception ([[except.nested]]), or
34
  - when execution of the initial function of a thread exits via an
35
  exception ([[thread.thread.constr]]), or
 
 
 
 
 
36
  - when the destructor or the copy assignment operator is invoked on an
37
  object of type `std::thread` that refers to a joinable thread (
38
- [[thread.thread.destr]],  [[thread.thread.assign]]).
 
 
 
 
 
39
 
40
  In such cases, `std::terminate()` is called ([[exception.terminate]]).
41
  In the situation where no matching handler is found, it is
42
  *implementation-defined* whether or not the stack is unwound before
43
  `std::terminate()` is called. In the situation where the search for a
44
  handler ([[except.handle]]) encounters the outermost block of a
45
- function with a *noexcept-specification* that does not allow the
46
- exception ([[except.spec]]), it is *implementation-defined* whether the
47
- stack is unwound, unwound partially, or not unwound at all before
48
- `std::terminate()` is called. In all other situations, the stack shall
49
- not be unwound before `std::terminate()` is called. An implementation is
50
- not permitted to finish stack unwinding prematurely based on a
51
- determination that the unwind process will eventually cause a call to
52
- `std::terminate()`.
53
 
 
1
  ### The `std::terminate()` function <a id="except.terminate">[[except.terminate]]</a>
2
 
3
  In some situations exception handling must be abandoned for less subtle
4
+ error handling techniques.
5
+
6
+ [*Note 1*:
7
+
8
+ These situations are:
9
 
10
  - when the exception handling mechanism, after completing the
11
  initialization of the exception object but before activation of a
12
  handler for the exception ([[except.throw]]), calls a function that
13
  exits via an exception, or
14
  - when the exception handling mechanism cannot find a handler for a
15
  thrown exception ([[except.handle]]), or
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-local 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]]),
27
  or
28
+ - when a *throw-expression* ([[expr.throw]]) with no operand attempts
29
+ to rethrow an exception and no exception is being handled (
30
+ [[except.throw]]), or
 
 
 
 
 
31
  - when the function `std::nested_exception::rethrow_nested` is called
32
  for an object that has captured no exception ([[except.nested]]), or
33
  - when execution of the initial function of a thread exits via an
34
  exception ([[thread.thread.constr]]), or
35
+ - for a parallel algorithm whose `ExecutionPolicy` specifies such
36
+ behavior ([[execpol.seq]], [[execpol.par]], [[execpol.parunseq]]),
37
+ when execution of an element access function (
38
+ [[algorithms.parallel.defns]]) of the parallel algorithm exits via an
39
+ exception ([[algorithms.parallel.exceptions]]), or
40
  - when the destructor or the copy assignment operator is invoked on an
41
  object of type `std::thread` that refers to a joinable thread (
42
+ [[thread.thread.destr]],  [[thread.thread.assign]]), or
43
+ - when a call to a `wait()`, `wait_until()`, or `wait_for()` function on
44
+ a condition variable ([[thread.condition.condvar]], 
45
+ [[thread.condition.condvarany]]) fails to meet a postcondition.
46
+
47
+ — *end note*]
48
 
49
  In such cases, `std::terminate()` is called ([[exception.terminate]]).
50
  In the situation where no matching handler is found, it is
51
  *implementation-defined* whether or not the stack is unwound before
52
  `std::terminate()` is called. In the situation where the search for a
53
  handler ([[except.handle]]) encounters the outermost block of a
54
+ 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 `std::terminate()` is called. In
57
+ all other situations, the stack shall not be unwound before
58
+ `std::terminate()` is called. An implementation is not permitted to
59
+ finish stack unwinding prematurely based on a determination that the
60
+ unwind process will eventually cause a call to `std::terminate()`.
 
61