Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[basic.start,except] Harmonize references to std::terminate #2187

Merged
merged 1 commit into from
Jul 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions source/basic.tex
Original file line number Diff line number Diff line change
Expand Up @@ -5512,9 +5512,10 @@
in which threads and at which points in the program such deferred dynamic initialization occurs.

\pnum
If the initialization of a non-local variable with static or thread storage duration
exits via
an exception, \tcode{std::terminate} is called\iref{except.terminate}.%
If the initialization of
a non-local variable with static or thread storage duration
exits via an exception,
the function \tcode{std::terminate} is called\iref{except.terminate}.%
\indextext{program!start|)}

\rSec3[basic.start.term]{Termination}
Expand Down Expand Up @@ -5560,7 +5561,7 @@
of the subobjects is destroyed.
If the destruction of an object with static or thread storage duration
exits via an exception,
\tcode{std::terminate} is called\iref{except.terminate}.
the function \tcode{std::terminate} is called\iref{except.terminate}.

\pnum
If a function contains a block-scope object of static or thread storage duration that has been
Expand Down
6 changes: 3 additions & 3 deletions source/declarations.tex
Original file line number Diff line number Diff line change
Expand Up @@ -4041,7 +4041,7 @@
are modifications of non-volatile objects
whose lifetime began and ended within the evaluation of the predicate.
An evaluation of a predicate that exits via an exception
invokes \tcode{std::terminate()}\iref{except.terminate}.
invokes the function \tcode{std::terminate}\iref{except.terminate}.
The behavior of any other side effect is undefined.
\begin{example}
\begin{codeblock}
Expand Down Expand Up @@ -4340,7 +4340,7 @@
with a non-throwing exception specification,
then the behavior is as if the exception escaped the function body.
\begin{note}
The function \tcode{std::terminate()} is invoked\iref{except.terminate}.
The function \tcode{std::terminate} is invoked\iref{except.terminate}.
\end{note}
\begin{example}
\begin{codeblock}
Expand All @@ -4359,7 +4359,7 @@
\term{off} or \term{on}.
A translation with violation continuation mode set to \term{off}
terminates execution
by invoking \tcode{std::terminate()}\iref{except.terminate}
by invoking the function \tcode{std::terminate}\iref{except.terminate}
after completing the execution of the violation handler.
A translation with a violation continuation mode set to \term{on}
continues execution after completing the execution of the violation handler.
Expand Down
36 changes: 18 additions & 18 deletions source/exceptions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@
If the exception handling mechanism
handling an uncaught exception\iref{except.uncaught}
directly invokes a function that exits via an
exception, \tcode{std::terminate} is called\iref{except.terminate}.
exception, the function \tcode{std::terminate} is called\iref{except.terminate}.
\begin{example}
\begin{codeblock}
struct C {
Expand All @@ -344,7 +344,7 @@

int main() {
try {
throw C(); // calls \tcode{std::terminate()} if construction of the handler's
throw C(); // calls \tcode{std::terminate} if construction of the handler's
// \grammarterm{exception-declaration} object is not elided\iref{class.copy}
} catch(C) { }
}
Expand Down Expand Up @@ -595,7 +595,7 @@
The stack will have been unwound at that point.
\end{note}
Also, an implicit handler is considered active when
\tcode{std::terminate()}
the function \tcode{std::terminate}
is entered due to a throw. A handler is no longer considered active when the
catch clause exits.

Expand All @@ -608,12 +608,12 @@
\pnum
If no matching handler is found,
the function
\tcode{std::terminate()}
\tcode{std::terminate}
is called;
whether or not the stack is unwound before this call to
\tcode{std::terminate()}
\tcode{std::terminate}
is \impldef{stack unwinding before call to
\tcode{std::terminate()}}\iref{except.terminate}.
\tcode{std::terminate}}\iref{except.terminate}.

\pnum
Referring to any non-static member or base class of an object
Expand Down Expand Up @@ -785,7 +785,7 @@
and the search for a handler\iref{except.handle}
encounters the outermost block of a function with a
non-throwing exception specification,
the function \tcode{std::terminate()} is called\iref{except.terminate}.
the function \tcode{std::terminate} is called\iref{except.terminate}.
\begin{note}
An implementation shall not reject an expression merely because, when
executed, it throws or might
Expand Down Expand Up @@ -872,7 +872,7 @@
their exception specifications do not contribute
to the exception specification of the constructor,
because an exception thrown from such a destructor
would call \tcode{std::terminate}
would call the function \tcode{std::terminate}
rather than escape the constructor~(\ref{except.throw}, \ref{except.terminate}).
\end{note}

Expand Down Expand Up @@ -976,15 +976,15 @@
\rSec1[except.special]{Special functions}

\pnum
The function \tcode{std::terminate()}\iref{except.terminate}
The function \tcode{std::terminate}\iref{except.terminate}
is used by the exception
handling mechanism for coping with errors related to the exception handling
mechanism itself. The function
\tcode{std::current_exception()}\iref{propagation} and the class
\tcode{std::nested_exception}\iref{except.nested} can be used by a program to
capture the currently handled exception.

\rSec2[except.terminate]{The \tcode{std::terminate()} function}
\rSec2[except.terminate]{The \tcode{std::terminate} function}

\pnum
\indextext{\idxcode{terminate}}%
Expand Down Expand Up @@ -1076,29 +1076,29 @@
\pnum
\indextext{\idxcode{terminate}}%
In such cases,
\tcode{std::terminate()}
the function \tcode{std::terminate}
is called\iref{exception.terminate}.
In the situation where no matching handler is found, it is
\impldef{stack unwinding before call to \tcode{std::terminate()}} whether or not the
\impldef{stack unwinding before call to \tcode{std::terminate}} whether or not the
stack is unwound
before
\tcode{std::terminate()}
\tcode{std::terminate}
is called.
In the situation where the search for a handler\iref{except.handle} encounters the
outermost block of a function
with a non-throwing exception specification\iref{except.spec}, it is
\impldef{whether stack is unwound before calling \tcode{std::ter\-mi\-nate()}
\impldef{whether stack is unwound before calling the function \tcode{std::terminate}
when a \tcode{noexcept} specification
is violated}
whether the stack is unwound, unwound partially, or not unwound at all
before \tcode{std::terminate()} is called.
before the function \tcode{std::terminate} is called.
In all other situations, the stack shall not be unwound before
\tcode{std::terminate()}
the function \tcode{std::terminate}
is called.
An implementation is not permitted to finish stack unwinding
prematurely based on a determination that the unwind process
will eventually cause a call to
\tcode{std::terminate()}.
will eventually cause a call to the function
\tcode{std::terminate}.

\rSec2[except.uncaught]{The \tcode{std::uncaught_exceptions()} function}%
\indexlibrary{\idxcode{uncaught_exceptions}}
Expand Down
10 changes: 5 additions & 5 deletions source/support.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1885,7 +1885,7 @@
\tcode{main}.}

If control leaves a registered function called by \tcode{exit} because the function does
not provide a handler for a thrown exception, \tcode{std::terminate()} shall be called\iref{except.terminate}.%
not provide a handler for a thrown exception, the function \tcode{std::terminate} shall be called\iref{except.terminate}.%
\indexlibrary{\idxcode{terminate}}%

\item
Expand Down Expand Up @@ -1962,7 +1962,7 @@
previously registered functions that had already been called at the time it was
registered. Objects shall not be destroyed as a result of calling \tcode{quick_exit}.
If control leaves a registered function called by \tcode{quick_exit} because the
function does not provide a handler for a thrown exception, \tcode{std::terminate()} shall
function does not provide a handler for a thrown exception, the function \tcode{std::terminate} shall
be called.\indexlibrary{\idxcode{terminate}}
\begin{note}
A function registered via \tcode{at_quick_exit}
Expand Down Expand Up @@ -3645,8 +3645,8 @@
\pnum
\remarks
When \tcode{uncaught_exceptions() > 0},
throwing an exception can result in a call of\\
\tcode{std::terminate()}\iref{except.terminate}.
throwing an exception can result in a call of the function
\tcode{std::terminate}\iref{except.terminate}.
\end{itemdescr}

\rSec2[propagation]{Exception propagation}
Expand Down Expand Up @@ -3801,7 +3801,7 @@

\begin{itemdescr}
\pnum
\effects If \tcode{nested_ptr()} returns a null pointer, the function calls \tcode{std::terminate()}.
\effects If \tcode{nested_ptr()} returns a null pointer, the function calls the function \tcode{std::terminate}.
Otherwise, it throws the stored exception captured by \tcode{*this}.
\end{itemdescr}

Expand Down