Skip to content

Commit 8e79f69

Browse files
jensmaurertkoeppe
authored andcommitted
[std] Use \keyword for 'static_cast'.
1 parent 7fcc852 commit 8e79f69

File tree

6 files changed

+23
-23
lines changed

6 files changed

+23
-23
lines changed

source/basic.tex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@
591591
other than \cv{}~\tcode{void*}, is converted to the type pointer to \tcode{T}
592592
or reference to \tcode{T} using a standard conversion\iref{conv},
593593
a \tcode{dynamic_cast}\iref{expr.dynamic.cast} or
594-
a \tcode{static_cast}\iref{expr.static.cast}, or
594+
a \keyword{static_cast}\iref{expr.static.cast}, or
595595
\item a class member access operator is applied to an expression of type
596596
\tcode{T}\iref{expr.ref}, or
597597
\item the \tcode{typeid} operator\iref{expr.typeid} or the
@@ -3393,7 +3393,7 @@
33933393
to a virtual base class, or
33943394
\item
33953395
the pointer is used as the operand of a
3396-
\tcode{static_cast}\iref{expr.static.cast}, except when the conversion
3396+
\keyword{static_cast}\iref{expr.static.cast}, except when the conversion
33973397
is to pointer to \cv{}~\tcode{void}, or to pointer to \cv{}~\tcode{void}
33983398
and subsequently to pointer to
33993399
\cv{}~\tcode{char},
@@ -4393,7 +4393,7 @@
43934393
a
43944394
\begin{itemize}
43954395
\item \tcode{const_cast}\iref{expr.const.cast},
4396-
\item \tcode{static_cast}\iref{expr.static.cast},
4396+
\item \keyword{static_cast}\iref{expr.static.cast},
43974397
\item \tcode{dynamic_cast}\iref{expr.dynamic.cast}, or
43984398
\item \tcode{reinterpret_cast}\iref{expr.reinterpret.cast}
43994399
\end{itemize}

source/declarations.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4438,7 +4438,7 @@
44384438
\item for an \grammarterm{initializer} that is a
44394439
parenthesized \grammarterm{expression-list} or a \grammarterm{braced-init-list},
44404440
\item for a \grammarterm{new-initializer}\iref{expr.new},
4441-
\item in a \tcode{static_cast} expression\iref{expr.static.cast},
4441+
\item in a \keyword{static_cast} expression\iref{expr.static.cast},
44424442
\item in a functional notation type conversion\iref{expr.type.conv}, and
44434443
\item in the \grammarterm{braced-init-list} form of a \grammarterm{condition}
44444444
\end{itemize}

source/expressions.tex

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2930,7 +2930,7 @@
29302930
\begin{note}
29312931
The \tcode{>} token following the
29322932
\grammarterm{type-id} in a \tcode{dynamic_cast},
2933-
\tcode{static_cast}, \tcode{reinterpret_cast}, or
2933+
\keyword{static_cast}, \tcode{reinterpret_cast}, or
29342934
\tcode{const_cast} can be the product of replacing a
29352935
\tcode{>>} token by two consecutive \tcode{>}
29362936
tokens\iref{temp.names}.
@@ -3718,7 +3718,7 @@
37183718
If \tcode{T} is an lvalue reference type
37193719
or an rvalue reference to function type, the result is an lvalue;
37203720
if \tcode{T} is an rvalue reference to object type, the result is an xvalue;
3721-
otherwise, the result is a prvalue. The \tcode{static_cast} operator shall not cast
3721+
otherwise, the result is a prvalue. The \keyword{static_cast} operator shall not cast
37223722
away constness\iref{expr.const.cast}.
37233723

37243724
\pnum
@@ -3759,7 +3759,7 @@
37593759
the result refers to the object or the specified base class subobject
37603760
thereof; otherwise, the lvalue-to-rvalue conversion\iref{conv.lval}
37613761
is applied to the bit-field and the resulting prvalue is used as the
3762-
\grammarterm{expression} of the \tcode{static_cast} for the remainder of this subclause.
3762+
\grammarterm{expression} of the \keyword{static_cast} for the remainder of this subclause.
37633763
If \tcode{T2} is an inaccessible\iref{class.access} or
37643764
ambiguous\iref{class.member.lookup} base class of \tcode{T1},
37653765
a program that necessitates such a cast is ill-formed.
@@ -3793,9 +3793,9 @@
37933793
\end{note}
37943794

37953795
\pnum
3796-
Otherwise, the \tcode{static_cast} shall perform one of the conversions
3796+
Otherwise, the \keyword{static_cast} shall perform one of the conversions
37973797
listed below. No other conversion shall be performed explicitly using a
3798-
\tcode{static_cast}.
3798+
\keyword{static_cast}.
37993799

38003800
\pnum
38013801
Any expression can be explicitly converted to type \cv{}~\tcode{void},
@@ -3818,8 +3818,8 @@
38183818
null pointer\iref{conv.ptr}, null member pointer\iref{conv.mem},
38193819
boolean\iref{conv.bool}, or
38203820
function pointer\iref{conv.fctptr}
3821-
conversion, can be performed explicitly using \tcode{static_cast}. A
3822-
program is ill-formed if it uses \tcode{static_cast} to perform the
3821+
conversion, can be performed explicitly using \keyword{static_cast}. A
3822+
program is ill-formed if it uses \keyword{static_cast} to perform the
38233823
inverse of an ill-formed standard conversion sequence.
38243824
\begin{example}
38253825
\begin{codeblock}
@@ -3836,7 +3836,7 @@
38363836
The lvalue-to-rvalue\iref{conv.lval},
38373837
array-to-pointer\iref{conv.array}, and
38383838
function-to-pointer\iref{conv.func} conversions are applied to the
3839-
operand. Such a \tcode{static_cast} is subject to the restriction that
3839+
operand. Such a \keyword{static_cast} is subject to the restriction that
38403840
the explicit conversion does not cast away
38413841
constness\iref{expr.const.cast}, and the following additional rules
38423842
for specific cases:
@@ -5659,7 +5659,7 @@
56595659
\pnum
56605660
An explicit type conversion can be expressed using functional
56615661
notation\iref{expr.type.conv}, a type conversion operator
5662-
(\tcode{dynamic_cast}, \tcode{static_cast}, \tcode{reinterpret_cast},
5662+
(\tcode{dynamic_cast}, \keyword{static_cast}, \tcode{reinterpret_cast},
56635663
\tcode{const_cast}), or the \term{cast} notation.
56645664

56655665
\begin{bnf}
@@ -5679,14 +5679,14 @@
56795679
\indextext{cast!static}%
56805680
\indextext{cast!reinterpret}%
56815681
\item a \tcode{const_cast}\iref{expr.const.cast},
5682-
\item a \tcode{static_cast}\iref{expr.static.cast},
5683-
\item a \tcode{static_cast} followed by a \tcode{const_cast},
5682+
\item a \keyword{static_cast}\iref{expr.static.cast},
5683+
\item a \keyword{static_cast} followed by a \tcode{const_cast},
56845684
\item a \tcode{reinterpret_cast}\iref{expr.reinterpret.cast}, or
56855685
\item a \tcode{reinterpret_cast} followed by a \tcode{const_cast},
56865686
\end{itemize}
56875687
can be performed using the cast notation of explicit type conversion.
56885688
The same semantic restrictions and behaviors apply, with the exception
5689-
that in performing a \tcode{static_cast} in the following situations the
5689+
that in performing a \keyword{static_cast} in the following situations the
56905690
conversion is valid even if the base class is inaccessible:
56915691
\begin{itemize}
56925692
\item a pointer to an object of derived class type or an lvalue or
@@ -5708,7 +5708,7 @@
57085708
above, the interpretation that appears first in the list is used, even
57095709
if a cast resulting from that interpretation is ill-formed. If a
57105710
conversion can be interpreted in more than one way as a
5711-
\tcode{static_cast} followed by a \tcode{const_cast}, the conversion is
5711+
\keyword{static_cast} followed by a \tcode{const_cast}, the conversion is
57125712
ill-formed.
57135713
\begin{example}
57145714
\begin{codeblock}
@@ -5717,7 +5717,7 @@
57175717
struct I2 : A { };
57185718
struct D : I1, I2 { };
57195719
A* foo( D* p ) {
5720-
return (A*)( p ); // ill-formed \tcode{static_cast} interpretation
5720+
return (A*)( p ); // ill-formed \keyword{static_cast} interpretation
57215721
}
57225722
\end{codeblock}
57235723
\end{example}
@@ -5728,7 +5728,7 @@
57285728
``pointer to incomplete class type''. The destination type of a cast
57295729
using the cast notation can be ``pointer to incomplete class type''. If
57305730
both the operand and destination types are class types and one or both
5731-
are incomplete, it is unspecified whether the \tcode{static_cast} or the
5731+
are incomplete, it is unspecified whether the \keyword{static_cast} or the
57325732
\tcode{reinterpret_cast} interpretation is used, even if there is an
57335733
inheritance relationship between the two classes.
57345734
\begin{note}

source/lib-intro.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2070,7 +2070,7 @@
20702070
or \tcode{X::const_pointer}. Then, \tcode{x1} and \tcode{x2} are
20712071
\defn{equivalently-valued} pointer values, if and only if both \tcode{x1} and \tcode{x2}
20722072
can be explicitly converted to the two corresponding objects \tcode{px1} and \tcode{px2}
2073-
of type \tcode{X::const_pointer}, using a sequence of \tcode{static_cast}s
2073+
of type \tcode{X::const_pointer}, using a sequence of \keyword{static_cast}s
20742074
using only these four types, and the expression \tcode{px1 == px2}
20752075
evaluates to \tcode{true}.
20762076

source/templates.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,7 @@
747747
\tcode{>}
748748
\begin{footnote}
749749
A \tcode{>} that encloses the \grammarterm{type-id}
750-
of a \tcode{dynamic_cast}, \tcode{static_cast}, \tcode{reinterpret_cast}
750+
of a \tcode{dynamic_cast}, \keyword{static_cast}, \tcode{reinterpret_cast}
751751
or \tcode{const_cast}, or which encloses the \grammarterm{template-argument}{s}
752752
of a subsequent \grammarterm{template-id}, is considered nested for the purpose
753753
of this description.
@@ -4373,7 +4373,7 @@
43734373
template<class T> struct S {
43744374
using Ptr = PtrTraits<T>::Ptr; // OK, in a \grammarterm{defining-type-id}
43754375
T::R f(T::P p) { // OK, class scope
4376-
return static_cast<T::R>(p); // OK, \grammarterm{type-id} of a \tcode{static_cast}
4376+
return static_cast<T::R>(p); // OK, \grammarterm{type-id} of a \keyword{static_cast}
43774377
}
43784378
auto g() -> S<T*>::Ptr; // OK, \grammarterm{trailing-return-type}
43794379
};

source/time.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1821,7 +1821,7 @@
18211821
\pnum
18221822
\begin{note}
18231823
This function does not use any implicit conversions; all conversions
1824-
are done with \tcode{static_cast}. It avoids multiplications and divisions when
1824+
are done with \keyword{static_cast}. It avoids multiplications and divisions when
18251825
it is known at compile time that one or more arguments is 1. Intermediate
18261826
computations are carried out in the widest representation and only converted to
18271827
the destination representation at the final step.

0 commit comments

Comments
 (0)