Skip to content

Commit 5d039ac

Browse files
jensmaurertkoeppe
authored andcommitted
Use \tcode for return/if/switch statement.
1 parent 12f2ee0 commit 5d039ac

File tree

9 files changed

+22
-22
lines changed

9 files changed

+22
-22
lines changed

source/basic.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3978,7 +3978,7 @@
39783978
of a comma expression\iref{expr.comma}, as a second or third operand
39793979
of \tcode{?:}\iref{expr.cond}, as the operand of
39803980
\tcode{typeid}, \tcode{noexcept}, or \tcode{decltype}, as
3981-
the expression in a return statement\iref{stmt.return} for a function
3981+
the expression in a \tcode{return} statement\iref{stmt.return} for a function
39823982
with the return type \cv{}~\tcode{void}, or as the operand of an explicit conversion
39833983
to type \cv{}~\tcode{void}.
39843984

@@ -5231,7 +5231,7 @@
52315231
\pnum
52325232
\indextext{termination!program}%
52335233
\indextext{\idxcode{main} function!return from}%
5234-
A return statement in \tcode{main} has the effect of leaving the main
5234+
A \tcode{return} statement\iref{stmt.return} in \tcode{main} has the effect of leaving the main
52355235
function (destroying any objects with automatic storage duration) and
52365236
calling \tcode{std::exit} with the return value as the argument.
52375237
If control flows off the end of

source/conversions.tex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@
4343
\item When used as operands of operators. The operator's requirements
4444
for its operands dictate the destination type\iref{expr.compound}.
4545

46-
\item When used in the condition of an \tcode{if} statement or iteration
47-
statement~(\ref{stmt.select}, \ref{stmt.iter}). The destination type is
46+
\item When used in the condition of an \tcode{if} statement\iref{stmt.if} or
47+
iteration statement\iref{stmt.iter}. The destination type is
4848
\tcode{bool}.
4949

50-
\item When used in the expression of a \tcode{switch} statement. The
51-
destination type is integral\iref{stmt.select}.
50+
\item When used in the expression of a \tcode{switch} statement\iref{stmt.switch}.
51+
The destination type is integral.
5252

5353
\item When used as the source expression for an initialization (which
5454
includes use as an argument in a function call and use as the expression

source/declarators.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3840,7 +3840,7 @@
38403840
\begin{itemize}
38413841
\item as the initializer in a variable definition\iref{dcl.init}
38423842
\item as the initializer in a \grammarterm{new-expression}\iref{expr.new}
3843-
\item in a return statement\iref{stmt.return}
3843+
\item in a \tcode{return} statement\iref{stmt.return}
38443844
\item as a \grammarterm{for-range-initializer}\iref{stmt.iter}
38453845
\item as a function argument\iref{expr.call}
38463846
\item as a subscript\iref{expr.sub}

source/exceptions.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@
634634
on the initial function of the thread.
635635

636636
\pnum
637-
If a return statement appears in a handler of the
637+
If a \tcode{return} statement\iref{stmt.return} appears in a handler of the
638638
\grammarterm{function-try-block}
639639
of a
640640
constructor, the program is ill-formed.

source/lib-intro.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@
504504
specified for the function invocations contained in the code sequence. The value
505505
returned from \tcode{F} is specified by \tcode{F}'s \Fundescx{Returns} element, or if \tcode{F}
506506
has no \Fundescx{Returns} element, a non-\tcode{void} return from \tcode{F} is specified by the
507-
\tcode{return} statements in the code sequence.
507+
\tcode{return} statements\iref{stmt.return} in the code sequence.
508508
If \tcode{F}'s semantics contains a \Fundescx{Throws},
509509
\Fundescx{Postconditions}, or \Fundescx{Complexity} element, then that supersedes any occurrences of that
510510
element in the code sequence.

source/preprocessor.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,8 @@
351351
Thus, the constant expression in the following
352352
\tcode{\#if}
353353
directive and
354-
\tcode{if}
355-
statement is not guaranteed to evaluate to the same value in these two
354+
\tcode{if} statement\iref{stmt.if}
355+
is not guaranteed to evaluate to the same value in these two
356356
contexts:
357357
\begin{codeblock}
358358
#if 'z' - 'a' == 25

source/special.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@
606606
\item A temporary object bound to a reference parameter in a function call\iref{expr.call}
607607
persists until the completion of the full-expression containing the call.
608608

609-
\item The lifetime of a temporary bound to the returned value in a function return statement\iref{stmt.return} is not extended; the temporary is destroyed at the end of the full-expression in the return statement.
609+
\item The lifetime of a temporary bound to the returned value in a function \tcode{return} statement\iref{stmt.return} is not extended; the temporary is destroyed at the end of the full-expression in the \tcode{return} statement.
610610

611611
\item A temporary bound to a reference in a \grammarterm{new-initializer}\iref{expr.new} persists until the completion of the full-expression containing the \grammarterm{new-initializer}.
612612
\begin{note} This may introduce a dangling reference. \end{note}

source/statements.tex

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@
128128
\pnum
129129
\indextext{label!\idxcode{case}}%
130130
\indextext{label!\idxcode{default}}%
131-
Case labels and default labels shall occur only in switch statements.
131+
Case labels and default labels shall occur only in \tcode{switch} statements.
132132

133133

134134
\rSec1[stmt.expr]{Expression statement}%
@@ -812,25 +812,25 @@
812812

813813
\pnum
814814
The \grammarterm{expr-or-braced-init-list}
815-
of a return statement is called its operand. A return statement with
815+
of a \tcode{return} statement is called its operand. A \tcode{return} statement with
816816
no operand shall be used only in a function whose return type is
817817
\cv{}~\tcode{void}, a constructor\iref{class.ctor}, or a
818818
destructor\iref{class.dtor}.
819819
\indextext{\idxcode{return}!constructor and}%
820820
\indextext{\idxcode{return}!constructor and}%
821-
A return statement with an operand of type \tcode{void} shall be used only
821+
A \tcode{return} statement with an operand of type \tcode{void} shall be used only
822822
in a function whose return type is \cv{}~\tcode{void}.
823-
A return statement with any other operand shall be used only
823+
A \tcode{return} statement with any other operand shall be used only
824824
in a function whose return type is not \cv{}~\tcode{void};
825825
\indextext{conversion!return type}%
826-
the return statement initializes the
826+
the \tcode{return} statement initializes the
827827
glvalue result or prvalue result object of the (explicit or implicit) function call
828828
by copy-initialization\iref{dcl.init} from the operand.
829829
\begin{note}
830-
A return statement can involve
830+
A \tcode{return} statement can involve
831831
an invocation of a constructor to perform a copy or move of the operand
832832
if it is not a prvalue or if its type differs from the return type of the function.
833-
A copy operation associated with a return statement may be elided or
833+
A copy operation associated with a \tcode{return} statement may be elided or
834834
converted to a move operation if an automatic storage duration variable is returned\iref{class.copy}.
835835
\end{note}
836836
\begin{example}
@@ -852,9 +852,9 @@
852852
\pnum
853853
The copy-initialization of the result of the call is sequenced before the
854854
destruction of temporaries at the end of the full-expression established
855-
by the operand of the return statement, which, in turn, is sequenced
855+
by the operand of the \tcode{return} statement, which, in turn, is sequenced
856856
before the destruction of local variables\iref{stmt.jump} of the block
857-
enclosing the return statement.
857+
enclosing the \tcode{return} statement.
858858

859859
\rSec2[stmt.goto]{The \tcode{goto} statement}%
860860
\indextext{statement!\idxcode{goto}}

source/utilities.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16591,7 +16591,7 @@
1659116591
\begin{note} This requirement gives well-defined results for reference types, void
1659216592
types, array types, and function types.\end{note} Access checking is performed
1659316593
in a context unrelated to \tcode{To} and \tcode{From}. Only the validity of
16594-
the immediate context of the \grammarterm{expression} of the \tcode{return} statement
16594+
the immediate context of the \grammarterm{expression} of the \tcode{return} statement\iref{stmt.return}
1659516595
(including initialization of the returned object or reference) is considered. \begin{note} The
1659616596
initialization can result in side effects such as the
1659716597
instantiation of class template specializations and function template

0 commit comments

Comments
 (0)