From Jason Turner

[expr.throw]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp3wqcvg6a/{from.md → to.md} +12 -12
tmp/tmp3wqcvg6a/{from.md → to.md} RENAMED
@@ -5,20 +5,24 @@ throw-expression:
5
  throw assignment-expressionₒₚₜ
6
  ```
7
 
8
  A *throw-expression* is of type `void`.
9
 
10
- Evaluating a *throw-expression* with an operand throws an exception
11
- [[except.throw]]; the type of the exception object is determined by
12
- removing any top-level *cv-qualifier*s from the static type of the
13
- operand and adjusting the type from “array of `T`” or function type `T`
14
- to “pointer to `T`”.
 
 
15
 
16
  A *throw-expression* with no operand rethrows the currently handled
17
- exception [[except.handle]]. The exception is reactivated with the
18
- existing exception object; no new exception object is created. The
19
- exception is no longer considered to be caught.
 
 
20
 
21
  [*Example 1*:
22
 
23
  An exception handler that cannot completely handle the exception itself
24
  can be written like this:
@@ -32,9 +36,5 @@ try {
32
  }
33
  ```
34
 
35
  — *end example*]
36
 
37
- If no exception is presently being handled, evaluating a
38
- *throw-expression* with no operand calls `std::{}terminate()`
39
- [[except.terminate]].
40
-
 
5
  throw assignment-expressionₒₚₜ
6
  ```
7
 
8
  A *throw-expression* is of type `void`.
9
 
10
+ A *throw-expression* with an operand throws an exception
11
+ [[except.throw]]. The array-to-pointer [[conv.array]] and
12
+ function-to-pointer [[conv.func]] standard conversions are performed on
13
+ the operand. The type of the exception object is determined by removing
14
+ any top-level *cv-qualifier*s from the type of the (possibly converted)
15
+ operand. The exception object is copy-initialized [[dcl.init.general]]
16
+ from the (possibly converted) operand.
17
 
18
  A *throw-expression* with no operand rethrows the currently handled
19
+ exception [[except.handle]]. If no exception is presently being handled,
20
+ the function `std::terminate` is invoked [[except.terminate]].
21
+ Otherwise, the exception is reactivated with the existing exception
22
+ object; no new exception object is created. The exception is no longer
23
+ considered to be caught.
24
 
25
  [*Example 1*:
26
 
27
  An exception handler that cannot completely handle the exception itself
28
  can be written like this:
 
36
  }
37
  ```
38
 
39
  — *end example*]
40