|
317 | 317 | the selected constructor is odr-used\iref{basic.def.odr} and |
318 | 318 | the destructor of \tcode{T} is potentially invoked\iref{class.dtor}. |
319 | 319 |
|
| 320 | +\pnum |
| 321 | +\indextext{exception handling!uncaught}% |
| 322 | +An exception is considered \defnx{uncaught}{uncaught exception} |
| 323 | +after completing the initialization of the exception object |
| 324 | +until completing the activation of a handler for the exception\iref{except.handle}. |
| 325 | +\begin{note} |
| 326 | +As a consequence, an exception is considered uncaught |
| 327 | +during any stack unwinding resulting from it being thrown. |
| 328 | +\end{note} |
| 329 | + |
320 | 330 | \pnum |
321 | 331 | \indextext{exception handling!rethrow}% |
322 | 332 | \indextext{rethrow|see{exception handling, rethrow}}% |
|
327 | 337 | it is rethrown. |
328 | 338 | \end{note} |
329 | 339 |
|
| 340 | +\pnum |
| 341 | +\indexlibraryglobal{uncaught_exceptions}% |
| 342 | +If an exception is rethrown\iref{expr.throw,propagation}, |
| 343 | +it is considered uncaught from the point of rethrow |
| 344 | +until the rethrown exception is caught. |
| 345 | +\begin{note} |
| 346 | +The function \tcode{std::uncaught_exceptions}\iref{uncaught.exceptions} |
| 347 | +returns the number of uncaught exceptions in the current thread. |
| 348 | +\end{note} |
| 349 | + |
330 | 350 | \pnum |
331 | 351 | \indextext{exception handling!terminate called@\tcode{terminate} called}% |
332 | 352 | \indextext{\idxcode{terminate}!called}% |
333 | 353 | If the exception handling mechanism |
334 | | -handling an uncaught exception\iref{except.uncaught} |
| 354 | +handling an uncaught exception |
335 | 355 | directly invokes a function that exits via an |
336 | 356 | exception, the function \tcode{std::terminate} is invoked\iref{except.terminate}. |
337 | 357 | \begin{example} |
|
1003 | 1023 | The function \tcode{std::terminate}\iref{except.terminate} |
1004 | 1024 | is used by the exception |
1005 | 1025 | handling mechanism for coping with errors related to the exception handling |
1006 | | -mechanism itself. The function |
1007 | | -\tcode{std::current_exception()}\iref{propagation} and the class |
| 1026 | +mechanism itself. The function \tcode{std::current_exception}\iref{propagation} and the class |
1008 | 1027 | \tcode{std::nested_exception}\iref{except.nested} can be used by a program to |
1009 | 1028 | capture the currently handled exception. |
1010 | 1029 |
|
|
1127 | 1146 | prematurely based on a determination that the unwind process |
1128 | 1147 | will eventually cause an invocation of the function |
1129 | 1148 | \tcode{std::terminate}. |
1130 | | - |
1131 | | -\rSec2[except.uncaught]{The \tcode{std::uncaught_exceptions} function}% |
1132 | | -\indexlibraryglobal{uncaught_exceptions} |
1133 | | - |
1134 | | -\pnum |
1135 | | -An exception is considered uncaught |
1136 | | -after completing the initialization of the exception object\iref{except.throw} |
1137 | | -until completing the activation of a handler for the exception\iref{except.handle}. |
1138 | | -\begin{note} |
1139 | | -As a consequence, an exception is considered uncaught |
1140 | | -during any stack unwinding resulting from it being thrown. |
1141 | | -\end{note} |
1142 | | -If an exception is rethrown\iref{expr.throw,propagation}, |
1143 | | -it is considered uncaught from the point of rethrow |
1144 | | -until the rethrown exception is caught. |
1145 | | -The function \tcode{std::uncaught_exceptions}\iref{uncaught.exceptions} |
1146 | | -returns the number of uncaught exceptions in the current thread.% |
1147 | 1149 | \indextext{exception handling|)} |
0 commit comments