Skip to content

Commit 212b655

Browse files
committed
[std] Use \keyword for 'consteval', 'constexpr', 'constinit'.
1 parent a40f8e4 commit 212b655

14 files changed

+62
-62
lines changed

source/classes.tex

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,7 @@
866866
it is inline\iref{dcl.inline}.
867867
\begin{note}
868868
A member function is also inline if it is declared
869-
\tcode{inline}, \tcode{constexpr}, or \tcode{consteval}.
869+
\tcode{inline}, \keyword{constexpr}, or \keyword{consteval}.
870870
\end{note}
871871

872872
\pnum
@@ -1142,7 +1142,7 @@
11421142
Constructors do not have names.
11431143
In a constructor declaration, each \grammarterm{decl-specifier} in the optional
11441144
\grammarterm{decl-specifier-seq} shall be \tcode{friend}, \tcode{inline},
1145-
\tcode{constexpr}, or an \grammarterm{explicit-specifier}.
1145+
\keyword{constexpr}, or an \grammarterm{explicit-specifier}.
11461146
\begin{example}
11471147
\begin{codeblock}
11481148
struct S {
@@ -1317,7 +1317,7 @@
13171317
the program is ill-formed.
13181318
If that user-written default constructor would satisfy the requirements
13191319
of a constexpr constructor\iref{dcl.constexpr}, the implicitly-defined
1320-
default constructor is \tcode{constexpr}.
1320+
default constructor is \keyword{constexpr}.
13211321
Before the defaulted default constructor for a class is
13221322
implicitly defined,
13231323
all the non-user-provided default constructors for its base classes and
@@ -1621,7 +1621,7 @@
16211621
\end{note}
16221622
If the implicitly-defined constructor would satisfy the requirements of a
16231623
constexpr constructor\iref{dcl.constexpr}, the implicitly-defined
1624-
constructor is \tcode{constexpr}.
1624+
constructor is \keyword{constexpr}.
16251625

16261626
\pnum
16271627
Before the defaulted copy/move constructor for a class is
@@ -1920,7 +1920,7 @@
19201920
to assign to an object of its class type),
19211921
when it is needed for constant evaluation\iref{expr.const}, or
19221922
when it is explicitly defaulted after its first declaration.
1923-
The implicitly-defined copy/move assignment operator is \tcode{constexpr} if
1923+
The implicitly-defined copy/move assignment operator is \keyword{constexpr} if
19241924
\begin{itemize}
19251925
\item
19261926
\tcode{X} is a literal type, and
@@ -2039,8 +2039,8 @@
20392039
\tcode{friend},
20402040
\tcode{inline},
20412041
\tcode{virtual},
2042-
\tcode{constexpr}, or
2043-
\tcode{consteval}.
2042+
\keyword{constexpr}, or
2043+
\keyword{consteval}.
20442044

20452045
\pnum
20462046
\indextext{generated destructor|see{destructor, default}}%
@@ -2749,7 +2749,7 @@
27492749
namespace scope definition shall not contain an \grammarterm{initializer}.
27502750
The declaration of an inline static data member (which is a definition)
27512751
may specify a \grammarterm{brace-or-equal-initializer}. If the
2752-
member is declared with the \tcode{constexpr} specifier, it may be
2752+
member is declared with the \keyword{constexpr} specifier, it may be
27532753
redeclared in namespace scope with no initializer (this usage is
27542754
deprecated; see \ref{depr.static.constexpr}). Declarations of other
27552755
static data members shall not specify a \grammarterm{brace-or-equal-initializer}.
@@ -3940,10 +3940,10 @@
39403940
\indextext{function!virtual|)}
39413941

39423942
\pnum
3943-
A \tcode{consteval} virtual function shall not override
3944-
a virtual function that is not \tcode{consteval}.
3945-
A \tcode{consteval} virtual function shall not be overridden by
3946-
a virtual function that is not \tcode{consteval}.
3943+
A \keyword{consteval} virtual function shall not override
3944+
a virtual function that is not \keyword{consteval}.
3945+
A \keyword{consteval} virtual function shall not be overridden by
3946+
a virtual function that is not \keyword{consteval}.
39473947

39483948
\rSec2[class.abstract]{Abstract classes}%
39493949

@@ -6380,8 +6380,8 @@
63806380
has the same \grammarterm{parameter-declaration-clause} and
63816381
trailing \grammarterm{requires-clause} as
63826382
the respective three-way comparison operator.
6383-
It is declared with \tcode{friend}, \tcode{virtual}, \tcode{constexpr},
6384-
or \tcode{consteval} if
6383+
It is declared with \tcode{friend}, \tcode{virtual}, \keyword{constexpr},
6384+
or \keyword{consteval} if
63856385
the three-way comparison operator function is so declared.
63866386
If the three-way comparison operator function
63876387
has no \grammarterm{noexcept-specifier},

source/compatibility.tex

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
The \tcode{concept} keyword is
7676
added to enable the definition of concepts\iref{temp.concept}.
7777
\item
78-
The \tcode{consteval} keyword is added to
78+
The \keyword{consteval} keyword is added to
7979
declare immediate functions\iref{dcl.constexpr}.
8080
\item
8181
The \keyword{constinit} keyword is added to
@@ -92,8 +92,8 @@
9292
Valid \CppXVII{} code using
9393
\keyword{char8_t},
9494
\tcode{concept},
95-
\tcode{consteval},
96-
\tcode{constinit},
95+
\keyword{consteval},
96+
\keyword{constinit},
9797
\tcode{co_await}, \tcode{co_yield}, \tcode{co_return},
9898
or \tcode{requires}
9999
as an identifier is not valid in this revision of \Cpp{}.
@@ -704,7 +704,7 @@
704704
\rationale
705705
The traits had unreliable or awkward interfaces. The \tcode{is_literal_type}
706706
trait provided no way to detect which subset of constructors and member
707-
functions of a type were declared \tcode{constexpr}. The \tcode{result_of}
707+
functions of a type were declared \keyword{constexpr}. The \tcode{result_of}
708708
trait had a surprising syntax that could not report the result of a regular
709709
function type. It has been superseded by the \tcode{invoke_result} trait.
710710
\effect
@@ -1165,10 +1165,10 @@
11651165

11661166
\diffref{dcl.constexpr}
11671167
\change
1168-
\tcode{constexpr} non-static member functions are not implicitly
1168+
\keyword{constexpr} non-static member functions are not implicitly
11691169
\tcode{const} member functions.
11701170
\rationale
1171-
Necessary to allow \tcode{constexpr} member functions to mutate
1171+
Necessary to allow \keyword{constexpr} member functions to mutate
11721172
the object.
11731173
\effect
11741174
Valid \CppXI{} code may fail to compile in this revision of \Cpp{}.
@@ -1285,7 +1285,7 @@
12851285
\tcode{alignof},
12861286
\keyword{char16_t},
12871287
\keyword{char32_t},
1288-
\tcode{constexpr},
1288+
\keyword{constexpr},
12891289
\tcode{decltype},
12901290
\tcode{noexcept},
12911291
\tcode{nullptr},

source/declarations.tex

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -701,23 +701,23 @@
701701
\indextext{specifier!\idxcode{consteval}}
702702

703703
\pnum
704-
The \tcode{constexpr} specifier shall be applied only to
704+
The \keyword{constexpr} specifier shall be applied only to
705705
the definition of a variable or variable template or
706706
the declaration of a function or function template.
707-
The \tcode{consteval} specifier shall be applied only to
707+
The \keyword{consteval} specifier shall be applied only to
708708
the declaration of a function or function template.
709709
A function or static data member
710-
declared with the \tcode{constexpr} or \tcode{consteval} specifier
710+
declared with the \keyword{constexpr} or \keyword{consteval} specifier
711711
is implicitly an inline function or variable\iref{dcl.inline}.
712712
If any declaration of a function or function template has
713-
a \tcode{constexpr} or \tcode{consteval} specifier,
713+
a \keyword{constexpr} or \keyword{consteval} specifier,
714714
then all its declarations shall contain the same specifier.
715715
\begin{note}
716716
An explicit specialization can differ from the template declaration
717-
with respect to the \tcode{constexpr} or \tcode{consteval} specifier.
717+
with respect to the \keyword{constexpr} or \keyword{consteval} specifier.
718718
\end{note}
719719
\begin{note}
720-
Function parameters cannot be declared \tcode{constexpr}.
720+
Function parameters cannot be declared \keyword{constexpr}.
721721
\end{note}
722722
\begin{example}
723723
\begin{codeblock}
@@ -732,7 +732,7 @@
732732
: x(a), y(x) // OK: definition
733733
{ square(x); }
734734
constexpr pixel small(2); // error: \tcode{square} not defined, so \tcode{small(2)}
735-
// not constant\iref{expr.const} so \tcode{constexpr} not satisfied
735+
// not constant\iref{expr.const} so \keyword{constexpr} not satisfied
736736

737737
constexpr void square(int &x) { // OK: definition
738738
x *= x;
@@ -746,14 +746,14 @@
746746
\end{example}
747747

748748
\pnum
749-
A \tcode{constexpr} or \tcode{consteval} specifier
749+
A \keyword{constexpr} or \keyword{consteval} specifier
750750
used in the declaration of a function
751751
declares that function to be
752752
a \defnx{constexpr function}{specifier!\idxcode{constexpr}!function}.
753-
A function or constructor declared with the \tcode{consteval} specifier
753+
A function or constructor declared with the \keyword{consteval} specifier
754754
is called an \defnadj{immediate}{function}.
755755
A destructor, an allocation function, or a deallocation function
756-
shall not be declared with the \tcode{consteval} specifier.
756+
shall not be declared with the \keyword{consteval} specifier.
757757

758758
\pnum
759759
\indextext{specifier!\idxcode{constexpr}!function}%
@@ -917,7 +917,7 @@
917917
\end{note}
918918

919919
\pnum
920-
The \tcode{constexpr} and \tcode{consteval} specifiers have no
920+
The \keyword{constexpr} and \keyword{consteval} specifiers have no
921921
effect on the type of a constexpr function.
922922
\begin{example}
923923
\begin{codeblock}
@@ -930,15 +930,15 @@
930930
\end{example}
931931

932932
\pnum
933-
A \tcode{constexpr} specifier used in an object declaration
933+
A \keyword{constexpr} specifier used in an object declaration
934934
declares the object as const.
935935
Such an object
936936
shall have literal type and
937937
shall be initialized.
938-
In any \tcode{constexpr} variable declaration,
938+
In any \keyword{constexpr} variable declaration,
939939
the full-expression of the initialization
940940
shall be a constant expression\iref{expr.const}.
941-
A \tcode{constexpr} variable shall have constant destruction.
941+
A \keyword{constexpr} variable shall have constant destruction.
942942
\begin{example}
943943
\begin{codeblock}
944944
struct pixel {
@@ -2615,7 +2615,7 @@
26152615
\tcode{friend},
26162616
\tcode{inline},
26172617
\tcode{virtual},
2618-
\tcode{constexpr},
2618+
\keyword{constexpr},
26192619
or
26202620
\tcode{typedef}
26212621
specifier
@@ -4223,7 +4223,7 @@
42234223
\end{note}
42244224

42254225
\pnum
4226-
Except for objects declared with the \tcode{constexpr} specifier, for which see~\ref{dcl.constexpr},
4226+
Except for objects declared with the \keyword{constexpr} specifier, for which see~\ref{dcl.constexpr},
42274227
an \grammarterm{initializer} in the definition of a variable can consist of
42284228
arbitrary expressions involving literals and previously declared
42294229
variables and functions,
@@ -6134,7 +6134,7 @@
61346134

61356135
\pnum
61366136
An explicitly-defaulted function that is not defined as deleted may be declared
6137-
\tcode{constexpr} or \tcode{consteval} only
6137+
\keyword{constexpr} or \keyword{consteval} only
61386138
if it is constexpr-compatible (\ref{special}, \ref{class.compare.default}).
61396139
A function explicitly defaulted on its first declaration
61406140
is implicitly inline\iref{dcl.inline},
@@ -6144,7 +6144,7 @@
61446144
\begin{example}
61456145
\begin{codeblock}
61466146
struct S {
6147-
constexpr S() = default; // error: implicit \tcode{S()} is not \tcode{constexpr}
6147+
constexpr S() = default; // error: implicit \tcode{S()} is not \keyword{constexpr}
61486148
S(int a = 0) = default; // error: default argument
61496149
void operator=(const S&) = default; // error: non-matching return type
61506150
~S() noexcept(false) = default; // OK, despite mismatched exception specification

source/expressions.tex

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1680,7 +1680,7 @@
16801680
\pnum
16811681
In the \grammarterm{decl-specifier-seq} of the \grammarterm{lambda-declarator},
16821682
each \grammarterm{decl-specifier}
1683-
shall be one of \tcode{mutable}, \tcode{constexpr}, or \tcode{consteval}.
1683+
shall be one of \tcode{mutable}, \keyword{constexpr}, or \keyword{consteval}.
16841684
\begin{note}
16851685
The trailing \grammarterm{requires-clause} is described in \ref{dcl.decl}.
16861686
\end{note}
@@ -1801,11 +1801,11 @@
18011801
is a constexpr function if either
18021802
the corresponding \grammarterm{lambda-expression}{'s}
18031803
\grammarterm{parameter-declaration-clause}
1804-
is followed by \tcode{constexpr} or \tcode{consteval}, or
1804+
is followed by \keyword{constexpr} or \keyword{consteval}, or
18051805
it satisfies the requirements for a constexpr function\iref{dcl.constexpr}.
18061806
It is an immediate function\iref{dcl.constexpr}
18071807
if the corresponding \grammarterm{lambda-expression}{'s}
1808-
\grammarterm{parameter-declaration-clause} is followed by \tcode{consteval}.
1808+
\grammarterm{parameter-declaration-clause} is followed by \keyword{consteval}.
18091809
\begin{example}
18101810
\begin{codeblock}
18111811
auto ID = [](auto a) { return a; };
@@ -1837,7 +1837,7 @@
18371837
constexpr auto one = monoid(1);
18381838
static_assert(add(one)(zero)() == one()); // OK
18391839

1840-
// Since \tcode{two} below is not declared \tcode{constexpr}, an evaluation of its \tcode{constexpr} member function call operator
1840+
// Since \tcode{two} below is not declared \keyword{constexpr}, an evaluation of its \tcode{constexpr} member function call operator
18411841
// cannot perform an lvalue-to-rvalue conversion on one of its subobjects (that represents its capture)
18421842
// in a constant expression.
18431843
auto two = monoid(2);
@@ -7260,7 +7260,7 @@
72607260
}
72617261
constexpr int f2(int k) {
72627262
int x = k; // OK: not required to be a constant expression
7263-
// because \tcode{x} is not \tcode{constexpr}
7263+
// because \tcode{x} is not \keyword{constexpr}
72647264
return x;
72657265
}
72667266

source/future.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@
160160
\rSec1[depr.static.constexpr]{Redeclaration of \tcode{static constexpr} data members}
161161

162162
\pnum
163-
For compatibility with prior revisions of \Cpp{}, a \tcode{constexpr}
163+
For compatibility with prior revisions of \Cpp{}, a \keyword{constexpr}
164164
static data member may be redundantly redeclared outside the class with no initializer.
165165
This usage is deprecated.
166166
\begin{example}

source/iterators.tex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4638,7 +4638,7 @@
46384638
\effects
46394639
Value-initializes \tcode{last}.
46404640
If \tcode{is_trivially_default_constructible_v<S>} is \tcode{true},
4641-
then this constructor is a \tcode{constexpr} constructor.
4641+
then this constructor is a \keyword{constexpr} constructor.
46424642
\end{itemdescr}
46434643

46444644
\indexlibraryctor{move_sentinel}%
@@ -5846,7 +5846,7 @@
58465846
\remarks
58475847
If the initializer \tcode{T()} in the declaration \tcode{auto x = T();}
58485848
is a constant initializer\iref{expr.const},
5849-
then these constructors are \tcode{constexpr} constructors.
5849+
then these constructors are \keyword{constexpr} constructors.
58505850
\end{itemdescr}
58515851

58525852

@@ -6140,7 +6140,7 @@
61406140
both construct an end-of-stream iterator object suitable for use
61416141
as an end-of-range.
61426142
All specializations of \tcode{istreambuf_iterator} shall have a trivial copy
6143-
constructor, a \tcode{constexpr} default constructor, and a trivial destructor.
6143+
constructor, a \keyword{constexpr} default constructor, and a trivial destructor.
61446144

61456145
\pnum
61466146
The result of

source/lib-intro.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2931,8 +2931,8 @@
29312931

29322932
\pnum
29332933
This document explicitly requires that certain standard library functions are
2934-
\tcode{constexpr}\iref{dcl.constexpr}. An implementation shall not declare
2935-
any standard library function signature as \tcode{constexpr} except for those where
2934+
\keyword{constexpr}\iref{dcl.constexpr}. An implementation shall not declare
2935+
any standard library function signature as \keyword{constexpr} except for those where
29362936
it is explicitly required.
29372937
Within any header that provides any non-defining declarations of constexpr
29382938
functions or constructors an implementation shall provide corresponding definitions.

source/numerics.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,7 +1198,7 @@
11981198
conj proj
11991199
imag real
12001200
\end{codeblock}
1201-
where \tcode{norm}, \tcode{conj}, \tcode{imag}, and \tcode{real} are \tcode{constexpr} overloads.
1201+
where \tcode{norm}, \tcode{conj}, \tcode{imag}, and \tcode{real} are \keyword{constexpr} overloads.
12021202

12031203
\pnum
12041204
\indextext{overloads!floating-point}%
@@ -1358,7 +1358,7 @@
13581358

13591359
\pnum
13601360
\remarks
1361-
This function is \tcode{constexpr} if and only if
1361+
This function is \keyword{constexpr} if and only if
13621362
\tcode{To}, \tcode{From}, and the types of all subobjects
13631363
of \tcode{To} and \tcode{From} are types \tcode{T} such that:
13641364
\begin{itemize}

source/overloading.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3826,7 +3826,7 @@
38263826
the constraints described above, they are ordinary namespace-scope functions and
38273827
function templates. In particular, they are looked up like ordinary functions
38283828
and function templates and they follow the same overload resolution rules. Also,
3829-
they can be declared \tcode{inline} or \tcode{constexpr},
3829+
they can be declared \tcode{inline} or \keyword{constexpr},
38303830
they can have internal, module, or external linkage,
38313831
they can be called explicitly, their addresses can be
38323832
taken, etc.

source/statements.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
\pnum
115115
In the \grammarterm{decl-specifier-seq} of a \grammarterm{condition}, each
116116
\grammarterm{decl-specifier} shall be either a \grammarterm{type-specifier}
117-
or \tcode{constexpr}.
117+
or \keyword{constexpr}.
118118

119119
\rSec1[stmt.label]{Labeled statement}%
120120
\indextext{statement!labeled}
@@ -626,7 +626,7 @@
626626
\pnum
627627
In the \grammarterm{decl-specifier-seq} of a \grammarterm{for-range-declaration},
628628
each \grammarterm{decl-specifier} shall be either a \grammarterm{type-specifier}
629-
or \tcode{constexpr}. The \grammarterm{decl-specifier-seq} shall not define a
629+
or \keyword{constexpr}. The \grammarterm{decl-specifier-seq} shall not define a
630630
class or enumeration.%
631631
\indextext{statement!iteration|)}
632632

0 commit comments

Comments
 (0)