@@ -1117,7 +1117,11 @@ catch-clauses:
1117
1117
catch-clauses catch-clause
1118
1118
1119
1119
catch-clause:
1120
- 'catch' '(' qualified-name variable-name ')' compound-statement
1120
+ 'catch' '(' catch-name-list variable-name ')' compound-statement
1121
+
1122
+ catch-name-list:
1123
+ qualified-name
1124
+ catch-name-list '|' qualified-name
1121
1125
1122
1126
finally-clause:
1123
1127
'finally' compound-statement
@@ -1134,17 +1138,20 @@ finally-clause:
1134
1138
<i ><a href =" #grammar-catch-clauses " >catch-clauses</a ></i > <i ><a href =" #grammar-catch-clause " >catch-clause</a ></i >
1135
1139
1136
1140
<i id =" grammar-catch-clause " >catch-clause:</i >
1137
- catch ( <i ><a href =" 09-lexical-structure.md#grammar-qualified-name " >qualified-name</a ></i > <i ><a href =" 09-lexical-structure.md#grammar-variable-name " >variable-name</a ></i > ) <i ><a href =" #grammar-compound-statement " >compound-statement</a ></i >
1141
+ catch ( <i ><a href =" #grammar-catch-name-list " >catch-name-list</a ></i > <i ><a href =" 09-lexical-structure.md#grammar-variable-name " >variable-name</a ></i > ) <i ><a href =" #grammar-compound-statement " >compound-statement</a ></i >
1142
+
1143
+ <i id =" grammar-catch-name-list " >catch-name-list:</i >
1144
+ <i ><a href =" 09-lexical-structure.md#grammar-qualified-name " >qualified-name</a ></i >
1145
+ <i ><a href =" #grammar-catch-name-list " >catch-name-list</a ></i > | <i ><a href =" 09-lexical-structure.md#grammar-qualified-name " >qualified-name</a ></i >
1138
1146
1139
1147
<i id =" grammar-finally-clause " >finally-clause:</i >
1140
1148
finally <i ><a href =" #grammar-compound-statement " >compound-statement</a ></i >
1141
1149
</pre >
1142
1150
1143
1151
** Constraints**
1144
1152
1145
- In a * catch-clause* , * parameter-declaration-list* must contain only one
1146
- parameter, and its type must be [ ` Exception ` ] ( 17-exception-handling.md#class-exception ) or a type derived from
1147
- that class, and that parameter must not be passed byRef.
1153
+ Each * qualified-name* inside a * catch-name-list* must name a type derivated from
1154
+ [ ` Exception ` ] ( 17-exception-handling.md#class-exception ) .
1148
1155
1149
1156
** Semantics**
1150
1157
@@ -1165,9 +1172,10 @@ try-block that encloses the call to the current function. This process
1165
1172
continues until a catch-block is found that can handle the current
1166
1173
exception.
1167
1174
1168
- The matching is done by considering the class specified by * qualified-name*
1169
- and comparing it to the type of the exception. If the exception is an
1170
- [ instance of] ( 10-expressions.md#instanceof-operator ) this class then the clause matches.
1175
+ The matching is done by considering the classes specified by * qualified-name*
1176
+ in * catch-name-list* and comparing it to the type of the exception. If the
1177
+ exception is an [ instance of] ( 10-expressions.md#instanceof-operator ) one of
1178
+ the specified classes then the clause matches.
1171
1179
1172
1180
If a matching catch-block is located, the Engine prepares to transfer
1173
1181
control to the first statement of that catch-block. However, before
0 commit comments