Skip to content

Commit 073cb0f

Browse files
committed
[std] Use \keyword for character types.
1 parent 22200fe commit 073cb0f

16 files changed

+99
-99
lines changed

source/atomics.tex

+8-8
Original file line numberDiff line numberDiff line change
@@ -1138,10 +1138,10 @@
11381138
\tcode{unsigned long},
11391139
\tcode{long long},
11401140
\tcode{unsigned long long},
1141-
\tcode{char8_t},
1142-
\tcode{char16_t},
1143-
\tcode{char32_t},
1144-
\tcode{wchar_t},
1141+
\keyword{char8_t},
1142+
\keyword{char16_t},
1143+
\keyword{char32_t},
1144+
\keyword{wchar_t},
11451145
and any other types needed by the typedefs in the header \libheaderref{cstdint}.
11461146
For each such type \tcode{\placeholder{integral}},
11471147
the specialization \tcode{atomic_ref<\placeholder{integral}>} provides
@@ -2114,10 +2114,10 @@
21142114
\tcode{unsigned long},
21152115
\tcode{long long},
21162116
\tcode{unsigned long long},
2117-
\tcode{char8_t},
2118-
\tcode{char16_t},
2119-
\tcode{char32_t},
2120-
\tcode{wchar_t},
2117+
\keyword{char8_t},
2118+
\keyword{char16_t},
2119+
\keyword{char32_t},
2120+
\keyword{wchar_t},
21212121
and any other types needed by the typedefs in the header \libheaderref{cstdint}.
21222122
For each such type \tcode{\placeholder{integral}}, the specialization
21232123
\tcode{atomic<\placeholder{integral}>} provides additional atomic operations appropriate to integral types.

source/basic.tex

+9-9
Original file line numberDiff line numberDiff line change
@@ -4926,7 +4926,7 @@
49264926
The three types \tcode{char}, \tcode{signed char}, and \tcode{unsigned char}
49274927
are collectively called
49284928
\defnx{ordinary character types}{type!ordinary character}.
4929-
The ordinary character types and \tcode{char8_t}
4929+
The ordinary character types and \keyword{char8_t}
49304930
are collectively called \defnx{narrow character types}{narrow character type}.
49314931
For narrow character types,
49324932
each possible bit pattern of the object representation represents
@@ -4943,26 +4943,26 @@
49434943
\indextext{\idxcode{wchar_t}|see{type, \tcode{wchar_t}}}%
49444944
\indextext{type!\idxcode{wchar_t}}%
49454945
\indextext{type!underlying!\idxcode{wchar_t}}%
4946-
Type \tcode{wchar_t} is a distinct type that has
4946+
Type \keyword{wchar_t} is a distinct type that has
49474947
an \impldef{underlying type of \tcode{wchar_t}}
49484948
signed or unsigned integer type as its underlying type.
4949-
The values of type \tcode{wchar_t} can represent
4949+
The values of type \keyword{wchar_t} can represent
49504950
distinct codes for all members of the largest extended character set
49514951
specified among the supported locales\iref{locale}.
49524952

49534953
\pnum
49544954
\indextext{\idxcode{char8_t}|see{type, \tcode{char8_t}}}%
49554955
\indextext{type!\idxcode{char8_t}}%
49564956
\indextext{type!underlying!\idxcode{char8_t}}%
4957-
Type \tcode{char8_t} denotes a distinct type
4957+
Type \keyword{char8_t} denotes a distinct type
49584958
whose underlying type is \tcode{unsigned char}.
49594959
\indextext{\idxcode{char16_t}|see{type, \tcode{char16_t}}}%
49604960
\indextext{\idxcode{char32_t}|see{type, \tcode{char32_t}}}%
49614961
\indextext{type!\idxcode{char16_t}}%
49624962
\indextext{type!\idxcode{char32_t}}%
49634963
\indextext{type!underlying!\idxcode{char16_t}}%
49644964
\indextext{type!underlying!\idxcode{char32_t}}%
4965-
Types \tcode{char16_t} and \tcode{char32_t} denote distinct types
4965+
Types \keyword{char16_t} and \keyword{char32_t} denote distinct types
49664966
whose underlying types are \tcode{uint_least16_t} and \tcode{uint_least32_t},
49674967
respectively, in \libheaderref{cstdint}.
49684968

@@ -4985,8 +4985,8 @@
49854985
\indextext{type!integral}%
49864986
Types
49874987
\tcode{bool},
4988-
\tcode{char}, \tcode{wchar_t},
4989-
\tcode{char8_t}, \tcode{char16_t}, \tcode{char32_t},
4988+
\tcode{char}, \keyword{wchar_t},
4989+
\keyword{char8_t}, \keyword{char16_t}, \keyword{char32_t},
49904990
and the signed and unsigned integer types are
49914991
collectively called
49924992
\defnx{integral types}{integral type}.
@@ -5381,8 +5381,8 @@
53815381
\indextext{type!\idxcode{wchar_t}}%
53825382
\indextext{type!\idxcode{char16_t}}%
53835383
\indextext{type!\idxcode{char32_t}}%
5384-
The ranks of \tcode{char8_t}, \tcode{char16_t}, \tcode{char32_t}, and
5385-
\tcode{wchar_t} equal the ranks of their underlying
5384+
The ranks of \keyword{char8_t}, \keyword{char16_t}, \keyword{char32_t}, and
5385+
\keyword{wchar_t} equal the ranks of their underlying
53865386
types\iref{basic.fundamental}.
53875387

53885388
\item The rank of any extended signed integer type relative to another

source/compatibility.tex

+15-15
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
Required for new features.
7070
\begin{itemize}
7171
\item
72-
The \tcode{char8_t} keyword is added to differentiate
72+
The \keyword{char8_t} keyword is added to differentiate
7373
the types of ordinary and UTF-8 literals\iref{lex.string}.
7474
\item
7575
The \tcode{concept} keyword is
@@ -90,7 +90,7 @@
9090
\end{itemize}
9191
\effectafteritemize
9292
Valid \CppXVII{} code using
93-
\tcode{char8_t},
93+
\keyword{char8_t},
9494
\tcode{concept},
9595
\tcode{consteval},
9696
\tcode{constinit},
@@ -132,7 +132,7 @@
132132
const auto *u8s = u8"text"; // \tcode{u8s} previously deduced as \tcode{const char*}; now deduced as \tcode{const char8_t*}
133133
const char *ps = u8s; // ill-formed; previously well-formed
134134

135-
auto u8c = u8'c'; // \tcode{u8c} previously deduced as \tcode{char}; now deduced as \tcode{char8_t}
135+
auto u8c = u8'c'; // \tcode{u8c} previously deduced as \tcode{char}; now deduced as \keyword{char8_t}
136136
char *pc = &u8c; // ill-formed; previously well-formed
137137

138138
std::string s = u8"text"; // ill-formed; previously well-formed
@@ -591,14 +591,14 @@
591591
\diffref{ostream.inserters.character}
592592
\change
593593
Overload resolution for ostream inserters
594-
used with \tcode{wchar_t}, \tcode{char16_t}, or \tcode{char32_t} types.
594+
used with \keyword{wchar_t}, \keyword{char16_t}, or \keyword{char32_t} types.
595595
\rationale
596596
Removal of surprising behavior.
597597
\effect
598598
Valid \CppXVII{} code that passes
599-
\tcode{wchar_t}, \tcode{char16_t}, or \tcode{char32_t} characters or strings
599+
\keyword{wchar_t}, \keyword{char16_t}, or \keyword{char32_t} characters or strings
600600
to \tcode{basic_ostream<char, ...>::operator<<} or
601-
that passes \tcode{char16_t} or \tcode{char32_t} characters or strings
601+
that passes \keyword{char16_t} or \keyword{char32_t} characters or strings
602602
to \tcode{basic_ostream<wchar_t, ...>::operator<<} is now ill-formed.
603603
\begin{codeblock}
604604
std::cout << u"text"; // previously formatted the string as a pointer value;
@@ -1283,8 +1283,8 @@
12831283
Added to \tref{lex.key}, the following identifiers are new keywords:
12841284
\tcode{alignas},
12851285
\tcode{alignof},
1286-
\tcode{char16_t},
1287-
\tcode{char32_t},
1286+
\keyword{char16_t},
1287+
\keyword{char32_t},
12881288
\tcode{constexpr},
12891289
\tcode{decltype},
12901290
\tcode{noexcept},
@@ -1848,7 +1848,7 @@
18481848
from ``array of \textit{some-integer-type}''
18491849
to ``array of \tcode{const char32_t}''.
18501850
The type of a wide string literal is changed
1851-
from ``array of \tcode{wchar_t}''
1851+
from ``array of \keyword{wchar_t}''
18521852
to ``array of \tcode{const wchar_t}''.
18531853
\rationale
18541854
This avoids calling an inappropriate overloaded function,
@@ -2686,22 +2686,22 @@
26862686

26872687
\rSec2[diff.mods.to.definitions]{Modifications to definitions}
26882688

2689-
\rSec3[diff.char16]{Types \tcode{char16_t} and \tcode{char32_t}}
2689+
\rSec3[diff.char16]{Types \keyword{char16_t} and \keyword{char32_t}}
26902690

26912691
\pnum
2692-
The types \tcode{char16_t} and \tcode{char32_t}
2692+
The types \keyword{char16_t} and \keyword{char32_t}
26932693
are distinct types rather than typedefs to existing integral types.
2694-
The tokens \tcode{char16_t} and \tcode{char32_t}
2694+
The tokens \keyword{char16_t} and \keyword{char32_t}
26952695
are keywords in \Cpp{}\iref{lex.key}.
26962696
They do not appear as macro or type names defined in
26972697
\libheaderref{cuchar}.
26982698

2699-
\rSec3[diff.wchar.t]{Type \tcode{wchar_t}}
2699+
\rSec3[diff.wchar.t]{Type \keyword{wchar_t}}
27002700

27012701
\pnum
2702-
The type \tcode{wchar_t} is a distinct type rather than a typedef to an
2702+
The type \keyword{wchar_t} is a distinct type rather than a typedef to an
27032703
existing integral type.
2704-
The token \tcode{wchar_t}
2704+
The token \keyword{wchar_t}
27052705
is a keyword in \Cpp{}\iref{lex.key}.
27062706
It does not appear as a macro or type name defined in any of
27072707
\libheaderref{cstddef},

source/declarations.tex

+12-12
Original file line numberDiff line numberDiff line change
@@ -1369,9 +1369,9 @@
13691369
\tcode{char} & ``\tcode{char}'' \\
13701370
\tcode{unsigned char} & ``\tcode{unsigned char}'' \\
13711371
\tcode{signed char} & ``\tcode{signed char}'' \\
1372-
\tcode{char8_t} & ``\tcode{char8_t}'' \\
1373-
\tcode{char16_t} & ``\tcode{char16_t}'' \\
1374-
\tcode{char32_t} & ``\tcode{char32_t}'' \\
1372+
\keyword{char8_t} & ``\tcode{char8_t}'' \\
1373+
\keyword{char16_t} & ``\tcode{char16_t}'' \\
1374+
\keyword{char32_t} & ``\tcode{char32_t}'' \\
13751375
\tcode{bool} & ``\tcode{bool}'' \\
13761376
\tcode{unsigned} & ``\tcode{unsigned int}'' \\
13771377
\tcode{unsigned int} & ``\tcode{unsigned int}'' \\
@@ -1396,7 +1396,7 @@
13961396
\tcode{signed short} & ``\tcode{short int}'' \\
13971397
\tcode{short int} & ``\tcode{short int}'' \\
13981398
\tcode{short} & ``\tcode{short int}'' \\
1399-
\tcode{wchar_t} & ``\tcode{wchar_t}'' \\
1399+
\keyword{wchar_t} & ``\tcode{wchar_t}'' \\
14001400
\tcode{float} & ``\tcode{float}'' \\
14011401
\tcode{double} & ``\tcode{double}'' \\
14021402
\tcode{long double} & ``\tcode{long double}'' \\
@@ -4464,11 +4464,11 @@
44644464
If the destination type is a reference type, see~\ref{dcl.init.ref}.
44654465
\item
44664466
If the destination type is an array of characters,
4467-
an array of \tcode{char8_t},
4468-
an array of \tcode{char16_t},
4469-
an array of \tcode{char32_t},
4467+
an array of \keyword{char8_t},
4468+
an array of \keyword{char16_t},
4469+
an array of \keyword{char32_t},
44704470
or an array of
4471-
\tcode{wchar_t},
4471+
\keyword{wchar_t},
44724472
and the initializer is a \grammarterm{string-literal}, see~\ref{dcl.init.string}.
44734473
\item If the initializer is \tcode{()}, the object is value-initialized.
44744474
\indextext{ambiguity!function declaration}%
@@ -5249,10 +5249,10 @@
52495249

52505250
\pnum
52515251
An array of ordinary character type\iref{basic.fundamental},
5252-
\tcode{char8_t} array,
5253-
\tcode{char16_t} array,
5254-
\tcode{char32_t} array,
5255-
or \tcode{wchar_t} array
5252+
\keyword{char8_t} array,
5253+
\keyword{char16_t} array,
5254+
\keyword{char32_t} array,
5255+
or \keyword{wchar_t} array
52565256
can be initialized by
52575257
an ordinary string literal,
52585258
UTF-8 string literal,

source/expressions.tex

+7-7
Original file line numberDiff line numberDiff line change
@@ -827,8 +827,8 @@
827827

828828
\pnum
829829
\indextext{promotion!integral}%
830-
A prvalue of an integer type other than \tcode{bool}, \tcode{char16_t},
831-
\tcode{char32_t}, or \tcode{wchar_t} whose integer conversion
830+
A prvalue of an integer type other than \tcode{bool}, \keyword{char16_t},
831+
\keyword{char32_t}, or \keyword{wchar_t} whose integer conversion
832832
rank\iref{conv.rank} is less than the rank of \tcode{int} can be
833833
converted to a prvalue of type \tcode{int} if \tcode{int} can represent
834834
all the values of the source type; otherwise, the source prvalue can be
@@ -838,14 +838,14 @@
838838
\indextext{type!underlying!\idxcode{wchar_t}}%
839839
\indextext{type!underlying!\idxcode{char16_t}}%
840840
\indextext{type!underlying!\idxcode{char32_t}}%
841-
A prvalue of type \tcode{char16_t}, \tcode{char32_t}, or
842-
\tcode{wchar_t}\iref{basic.fundamental} can be converted to a prvalue
841+
A prvalue of type \keyword{char16_t}, \keyword{char32_t}, or
842+
\keyword{wchar_t}\iref{basic.fundamental} can be converted to a prvalue
843843
of the first of the following types that can represent all the values of
844844
its underlying type: \tcode{int}, \tcode{unsigned int}, \tcode{long int},
845845
\tcode{unsigned long int}, \tcode{long long int},
846846
or \tcode{unsigned long long int}. If none of the types in that list can
847847
represent all the values of its underlying type, a prvalue of type
848-
\tcode{char16_t}, \tcode{char32_t}, or \tcode{wchar_t} can be converted
848+
\keyword{char16_t}, \keyword{char32_t}, or \keyword{wchar_t} can be converted
849849
to a prvalue of its underlying type.
850850

851851
\pnum
@@ -1124,8 +1124,8 @@
11241124
\item Otherwise, the integral promotions\iref{conv.prom} shall be
11251125
performed on both operands.
11261126
\begin{footnote}
1127-
As a consequence, operands of type \tcode{bool}, \tcode{char8_t}, \tcode{char16_t},
1128-
\tcode{char32_t}, \tcode{wchar_t}, or an enumerated type are converted
1127+
As a consequence, operands of type \tcode{bool}, \keyword{char8_t}, \keyword{char16_t},
1128+
\keyword{char32_t}, \keyword{wchar_t}, or an enumerated type are converted
11291129
to some integral type.
11301130
\end{footnote}
11311131
Then the following rules shall be applied to the promoted operands:

source/future.tex

+4-4
Original file line numberDiff line numberDiff line change
@@ -2145,7 +2145,7 @@
21452145
\begin{itemize}
21462146
\item
21472147
\tcode{Elem} is the wide-character type, such as
2148-
\tcode{wchar_t}, \tcode{char16_t}, or \tcode{char32_t}.
2148+
\keyword{wchar_t}, \keyword{char16_t}, or \keyword{char32_t}.
21492149
\item
21502150
\tcode{Maxcode} is the largest wide-character code that the facet
21512151
will read or write without reporting a conversion error.
@@ -2678,7 +2678,7 @@
26782678
\pnum
26792679
\requires The \tcode{source} and \range{first}{last}
26802680
sequences are UTF-8 encoded. The value type of \tcode{Source}
2681-
and \tcode{InputIterator} is \tcode{char} or \tcode{char8_t}.
2681+
and \tcode{InputIterator} is \tcode{char} or \keyword{char8_t}.
26822682
\tcode{Source} meets the requirements specified in \ref{fs.path.req}.
26832683

26842684
\pnum
@@ -2688,9 +2688,9 @@
26882688
narrow encoding\iref{fs.path.type.cvt} is UTF-8,
26892689
return \tcode{path(source)} or \tcode{path(first, last)};
26902690
otherwise,
2691-
\item if \tcode{value_type} is \tcode{wchar_t} and the
2691+
\item if \tcode{value_type} is \keyword{wchar_t} and the
26922692
native wide encoding is UTF-16, or
2693-
if \tcode{value_type} is \tcode{char16_t} or \tcode{char32_t},
2693+
if \tcode{value_type} is \keyword{char16_t} or \keyword{char32_t},
26942694
convert \tcode{source} or \range{first}{last}
26952695
to a temporary, \tcode{tmp}, of type \tcode{string_type} and
26962696
return \tcode{path(tmp)};

source/intro.tex

+4-4
Original file line numberDiff line numberDiff line change
@@ -197,11 +197,11 @@
197197
\begin{defnote}
198198
The term does not mean only
199199
\tcode{char},
200-
\tcode{char8_t},
201-
\tcode{char16_t},
202-
\tcode{char32_t},
200+
\keyword{char8_t},
201+
\keyword{char16_t},
202+
\keyword{char32_t},
203203
and
204-
\tcode{wchar_t}
204+
\keyword{wchar_t}
205205
objects\iref{basic.fundamental},
206206
but any value that can be represented by a type
207207
that provides the definitions specified in

0 commit comments

Comments
 (0)