Skip to content

Commit 65d656b

Browse files
authored
Fix formatting of exception handling details
1 parent a2fd034 commit 65d656b

File tree

1 file changed

+19
-19
lines changed
  • src/content/docs/cpp/language/exceptions

1 file changed

+19
-19
lines changed

src/content/docs/cpp/language/exceptions/catch.mdx

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,18 @@ An <DocLink dest="/cpp/language/exceptions">exception</DocLink> can be handled b
5454
</ParamDoc>
5555
<ParamDoc name="compound-statement">
5656
a <DocLink dest="/cpp/language/statements#Compound_statements">compound statement</DocLink>
57-
</ParamDoc>
57+
</ParamDoc>
5858
</ParamDocList>
5959

6060
The parameter declaration in a handler describes the type(s) of exceptions that can cause that handler to be entered.
6161

6262
If the parameter is declared to have one of the following types, the program is ill-formed:
6363

64-
- an <DocLink dest="/cpp/language/basic_concepts/definition#Incomplete_type">incomplete type</DocLink>
65-
- an <DocLink dest="/cpp/language/classes#Abstract_classes">abstract class type</DocLink>
66-
- an <DocLink dest="/cpp/language/reference#Rvalue_reference"><Revision since="C++11">rvalue reference type</Revision></DocLink>
67-
- a pointer to an incomplete type other than (possibly cv-qualified) `void`
68-
- an lvalue reference to an incomplete type
64+
- an <DocLink dest="/cpp/language/basic_concepts/definition#Incomplete_type">incomplete type</DocLink>
65+
- an <DocLink dest="/cpp/language/classes#Abstract_classes">abstract class type</DocLink>
66+
- an <DocLink dest="/cpp/language/reference#Rvalue_reference"><Revision since="C++11">rvalue reference type</Revision></DocLink>
67+
- a pointer to an incomplete type other than (possibly cv-qualified) `void`
68+
- an lvalue reference to an incomplete type
6969

7070
If the parameter is declared to have type “array of `T`” or function type `T`, the type is adjusted to “pointer to `T`”.
7171

@@ -77,15 +77,15 @@ Each `try` block associates with a number of handlers, these handlers form a han
7777

7878
A handler is a match for an <DocLink dest="/cpp/language/exceptions/throwing_exceptions#Exception_object">exception object</DocLink> of type `E` if any of the following conditions is satisfied:
7979

80-
- The handler is of type “possibly cv-qualified `T`” or “lvalue reference to possibly cv-qualified `T`”, and any of the following conditions is satisfied:
81-
- `E` and `T` are the same type (ignoring the top-level cv-qualifiers).
82-
- `T` is an unambiguous public base class of `E`.
83-
- The handler is of type “possibly cv-qualified `T`” or `const T&` where `T` is a pointer or pointer-to-member type, and any of the following conditions is satisfied:
84-
- `E` is a pointer or pointer-to-member type that can be converted to `T` by at least one of the following conversions:
85-
- A <DocLink dest="/cpp/language/implicit_cast#Pointer_conversions">standard pointer conversion</DocLink> not involving conversions to pointers to private or protected or ambiguous classes.
86-
- <Revision since="C++17">A <DocLink dest="/cpp/language/implicit_cast#Function_pointer_conversions">function pointer conversion.</DocLink></Revision>
87-
- A <DocLink dest="/cpp/language/implicit_cast#Qualification_conversions">qualification conversion</DocLink>.
88-
- <Revision since="C++11">`E` is <DocLink dest="/cpp/types/nullptr_t">std::nullptr_t</DocLink>.</Revision>
80+
- The handler is of type “possibly cv-qualified `T`” or “lvalue reference to possibly cv-qualified `T`”, and any of the following conditions is satisfied:
81+
- `E` and `T` are the same type (ignoring the top-level cv-qualifiers).
82+
- `T` is an unambiguous public base class of `E`.
83+
- The handler is of type “possibly cv-qualified `T`” or `const T&` where `T` is a pointer or pointer-to-member type, and any of the following conditions is satisfied:
84+
- `E` is a pointer or pointer-to-member type that can be converted to `T` by at least one of the following conversions:
85+
- A <DocLink dest="/cpp/language/implicit_cast#Pointer_conversions">standard pointer conversion</DocLink> not involving conversions to pointers to private or protected or ambiguous classes.
86+
- <Revision since="C++17">A <DocLink dest="/cpp/language/implicit_cast#Function_pointer_conversions">function pointer conversion.</DocLink></Revision>
87+
- A <DocLink dest="/cpp/language/implicit_cast#Qualification_conversions">qualification conversion</DocLink>.
88+
- <Revision since="C++11">`E` is <DocLink dest="/cpp/types/nullptr_t">std::nullptr_t</DocLink>.</Revision>
8989

9090
The `catch (...)` handler matches exceptions of any type. If present, it can only be the last handler in a handler sequence. This handler may be used to ensure that no uncaught exceptions can possibly escape from a function that offers <DocLink dest="/cpp/language/exceptions">nothrow exception guarantee</DocLink>.
9191
```cpp
@@ -114,8 +114,8 @@ When an exception is thrown, control is transferred to the nearest handler with
114114

115115
The parameter declared in the parameter list (if any), of type “possibly cv-qualified `T`” or “lvalue reference to possibly cv-qualified `T`”, is initialized from the <DocLink dest="/cpp/language/exceptions/throwing_exceptions#Exception_object">exception object</DocLink>, of type `E`, as follows:
116116

117-
- If `T` is a base class of `E`, the parameter is <DocLink dest="/cpp/language/copy_initialization">copy-initialized</DocLink> from an lvalue of type `T` designating the corresponding base class subobject of the exception object.
118-
- Otherwise, the parameter is copy-initialized from an lvalue of type `E` designating the exception object.
117+
- If `T` is a base class of `E`, the parameter is <DocLink dest="/cpp/language/copy_initialization">copy-initialized</DocLink> from an lvalue of type `T` designating the corresponding base class subobject of the exception object.
118+
- Otherwise, the parameter is copy-initialized from an lvalue of type `E` designating the exception object.
119119

120120
The lifetime of the parameter ends when the handler exits, after the destruction of any objects with automatic <DocLink dest="/cpp/language/storage_duration">storage duration</DocLink> initialized within the handler.
121121

@@ -159,7 +159,7 @@ void f()
159159

160160
The exception thrown by the `throw` expression `throw 0` does not match a handler of pointer or pointer-to-member type.
161161

162-
- <Revision since="C++11">`throw nullptr` can be used instead to throw a null pointer that matches such handlers.</Revision>
162+
- <Revision since="C++11">`throw nullptr` can be used instead to throw a null pointer that matches such handlers.</Revision>
163163

164164
<DocLink dest="/cpp/language/exceptions/throwing_exceptions#Exception_object">Exception objects</DocLink> can never have array or function types, therefore a handler of reference to array or function type is never a match for any exception object.
165165

@@ -200,7 +200,7 @@ catch (const float* pf)
200200

201201
### Keywords
202202

203-
- <DocLink dest="/cpp/keyword/catch">`catch`</DocLink>
203+
- <DocLink dest="/cpp/keyword/catch">`catch`</DocLink>
204204

205205
### Example
206206

0 commit comments

Comments
 (0)