|
330 | 330 | If the exception handling mechanism
|
331 | 331 | handling an uncaught exception\iref{except.uncaught}
|
332 | 332 | directly invokes a function that exits via an
|
333 |
| -exception, \tcode{std::terminate} is called\iref{except.terminate}. |
| 333 | +exception, the function \tcode{std::terminate} is called\iref{except.terminate}. |
334 | 334 | \begin{example}
|
335 | 335 | \begin{codeblock}
|
336 | 336 | struct C {
|
|
344 | 344 |
|
345 | 345 | int main() {
|
346 | 346 | try {
|
347 |
| - throw C(); // calls \tcode{std::terminate()} if construction of the handler's |
| 347 | + throw C(); // calls \tcode{std::terminate} if construction of the handler's |
348 | 348 | // \grammarterm{exception-declaration} object is not elided\iref{class.copy}
|
349 | 349 | } catch(C) { }
|
350 | 350 | }
|
|
595 | 595 | The stack will have been unwound at that point.
|
596 | 596 | \end{note}
|
597 | 597 | Also, an implicit handler is considered active when
|
598 |
| -\tcode{std::terminate()} |
| 598 | +the function \tcode{std::terminate} |
599 | 599 | is entered due to a throw. A handler is no longer considered active when the
|
600 | 600 | catch clause exits.
|
601 | 601 |
|
|
608 | 608 | \pnum
|
609 | 609 | If no matching handler is found,
|
610 | 610 | the function
|
611 |
| -\tcode{std::terminate()} |
| 611 | +\tcode{std::terminate} |
612 | 612 | is called;
|
613 | 613 | whether or not the stack is unwound before this call to
|
614 |
| -\tcode{std::terminate()} |
| 614 | +\tcode{std::terminate} |
615 | 615 | is \impldef{stack unwinding before call to
|
616 |
| -\tcode{std::terminate()}}\iref{except.terminate}. |
| 616 | +\tcode{std::terminate}}\iref{except.terminate}. |
617 | 617 |
|
618 | 618 | \pnum
|
619 | 619 | Referring to any non-static member or base class of an object
|
|
785 | 785 | and the search for a handler\iref{except.handle}
|
786 | 786 | encounters the outermost block of a function with a
|
787 | 787 | non-throwing exception specification,
|
788 |
| -the function \tcode{std::terminate()} is called\iref{except.terminate}. |
| 788 | +the function \tcode{std::terminate} is called\iref{except.terminate}. |
789 | 789 | \begin{note}
|
790 | 790 | An implementation shall not reject an expression merely because, when
|
791 | 791 | executed, it throws or might
|
|
872 | 872 | their exception specifications do not contribute
|
873 | 873 | to the exception specification of the constructor,
|
874 | 874 | because an exception thrown from such a destructor
|
875 |
| -would call \tcode{std::terminate} |
| 875 | +would call the function \tcode{std::terminate} |
876 | 876 | rather than escape the constructor~(\ref{except.throw}, \ref{except.terminate}).
|
877 | 877 | \end{note}
|
878 | 878 |
|
|
976 | 976 | \rSec1[except.special]{Special functions}
|
977 | 977 |
|
978 | 978 | \pnum
|
979 |
| -The function \tcode{std::terminate()}\iref{except.terminate} |
| 979 | +The function \tcode{std::terminate}\iref{except.terminate} |
980 | 980 | is used by the exception
|
981 | 981 | handling mechanism for coping with errors related to the exception handling
|
982 | 982 | mechanism itself. The function
|
983 | 983 | \tcode{std::current_exception()}\iref{propagation} and the class
|
984 | 984 | \tcode{std::nested_exception}\iref{except.nested} can be used by a program to
|
985 | 985 | capture the currently handled exception.
|
986 | 986 |
|
987 |
| -\rSec2[except.terminate]{The \tcode{std::terminate()} function} |
| 987 | +\rSec2[except.terminate]{The \tcode{std::terminate} function} |
988 | 988 |
|
989 | 989 | \pnum
|
990 | 990 | \indextext{\idxcode{terminate}}%
|
|
1076 | 1076 | \pnum
|
1077 | 1077 | \indextext{\idxcode{terminate}}%
|
1078 | 1078 | In such cases,
|
1079 |
| -\tcode{std::terminate()} |
| 1079 | +the function \tcode{std::terminate} |
1080 | 1080 | is called\iref{exception.terminate}.
|
1081 | 1081 | In the situation where no matching handler is found, it is
|
1082 |
| -\impldef{stack unwinding before call to \tcode{std::terminate()}} whether or not the |
| 1082 | +\impldef{stack unwinding before call to \tcode{std::terminate}} whether or not the |
1083 | 1083 | stack is unwound
|
1084 | 1084 | before
|
1085 |
| -\tcode{std::terminate()} |
| 1085 | +\tcode{std::terminate} |
1086 | 1086 | is called.
|
1087 | 1087 | In the situation where the search for a handler\iref{except.handle} encounters the
|
1088 | 1088 | outermost block of a function
|
1089 | 1089 | with a non-throwing exception specification\iref{except.spec}, it is
|
1090 |
| -\impldef{whether stack is unwound before calling \tcode{std::ter\-mi\-nate()} |
| 1090 | +\impldef{whether stack is unwound before calling the function \tcode{std::terminate} |
1091 | 1091 | when a \tcode{noexcept} specification
|
1092 | 1092 | is violated}
|
1093 | 1093 | whether the stack is unwound, unwound partially, or not unwound at all
|
1094 |
| -before \tcode{std::terminate()} is called. |
| 1094 | +before the function \tcode{std::terminate} is called. |
1095 | 1095 | In all other situations, the stack shall not be unwound before
|
1096 |
| -\tcode{std::terminate()} |
| 1096 | +the function \tcode{std::terminate} |
1097 | 1097 | is called.
|
1098 | 1098 | An implementation is not permitted to finish stack unwinding
|
1099 | 1099 | prematurely based on a determination that the unwind process
|
1100 |
| -will eventually cause a call to |
1101 |
| -\tcode{std::terminate()}. |
| 1100 | +will eventually cause a call to the function |
| 1101 | +\tcode{std::terminate}. |
1102 | 1102 |
|
1103 | 1103 | \rSec2[except.uncaught]{The \tcode{std::uncaught_exceptions()} function}%
|
1104 | 1104 | \indexlibrary{\idxcode{uncaught_exceptions}}
|
|
0 commit comments