Skip to content

Commit 7b130cf

Browse files
jensmaurertkoeppe
authored andcommitted
[conv,expr,temp] Use \cv{} where appropriate (#1995)
1 parent ab5b669 commit 7b130cf

File tree

4 files changed

+42
-42
lines changed

4 files changed

+42
-42
lines changed

source/conversions.tex

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
well-formed if and only if \tcode{e} can be implicitly converted to a type \tcode{T}
8181
that is determined as follows:
8282
\tcode{E} is searched for non-explicit conversion functions
83-
whose return type is \cvqual{cv} \tcode{T} or reference to \cvqual{cv}
83+
whose return type is \cv{} \tcode{T} or reference to \cv{}
8484
\tcode{T} such that \tcode{T} is allowed by the context.
8585
There shall be exactly one such \tcode{T}.
8686

@@ -241,29 +241,29 @@
241241
\pnum
242242
A \defn{cv-decomposition} of a type \tcode{T}
243243
is a sequence of
244-
$cv_i$ and $P_i$
244+
$\cv{}_i$ and $P_i$
245245
such that \tcode{T} is
246246
\begin{indented}
247-
``$cv_0$ $P_0$ $cv_1$ $P_1$ $\cdots$ $cv_{n-1}$ $P_{n-1}$ $cv_n$ \tcode{U}'' for $n > 0$,
247+
``$\cv{}_0$ $P_0$ $\cv{}_1$ $P_1$ $\cdots$ $\cv{}_{n-1}$ $P_{n-1}$ $\cv{}_n$ \tcode{U}'' for $n > 0$,
248248
\end{indented}
249249
where
250-
each $cv_i$ is a set of cv-qualifiers\iref{basic.type.qualifier}, and
250+
each $\cv{}_i$ is a set of cv-qualifiers\iref{basic.type.qualifier}, and
251251
each $P_i$ is
252252
``pointer to''\iref{dcl.ptr},
253253
``pointer to member of class $C_i$ of type''\iref{dcl.mptr},
254254
``array of $N_i$'', or
255255
``array of unknown bound of''\iref{dcl.array}.
256256
If $P_i$ designates an array,
257-
the cv-qualifiers $cv_{i+1}$ on the element type are also taken as
258-
the cv-qualifiers $cv_i$ of the array.
257+
the cv-qualifiers $\cv{}_{i+1}$ on the element type are also taken as
258+
the cv-qualifiers $\cv{}_i$ of the array.
259259
\begin{example}
260260
The type denoted by the \grammarterm{type-id} \tcode{const int **}
261261
has two cv-decompositions,
262262
taking \tcode{U} as ``\tcode{int}'' and as ``pointer to \tcode{const int}''.
263263
\end{example}
264264
The $n$-tuple of cv-qualifiers after the first one
265265
in the longest cv-decomposition of \tcode{T}, that is,
266-
$cv_1, cv_2, \dotsc, cv_n$, is called the
266+
$\cv{}_1, \cv{}_2, \dotsc, \cv{}_n$, is called the
267267
\defn{cv-qualification signature} of \tcode{T}.
268268

269269
\pnum
@@ -280,16 +280,16 @@
280280
% NB: forbid line break between 'where' and 'cv'
281281
% to stop superscript j from running into
282282
% descender of p on the previous line.
283-
where~$cv_i^j$ denotes the cv-qualifiers in the cv-qualification signature of $\tcode{T}_j$:%
283+
where~$\cv{}_i^j$ denotes the cv-qualifiers in the cv-qualification signature of $\tcode{T}_j$:%
284284
\footnote{These rules ensure that const-safety is preserved by the conversion.}
285285

286286
\begin{itemize}
287287
\item $\tcode{T}_1$ and $\tcode{T}_2$ are similar.
288288

289-
\item For every $i > 0$, if \tcode{const} is in $\text{\cv}_i^1$ then \tcode{const} is in $\text{\cv}_i^2$, and similarly for \tcode{volatile}.
289+
\item For every $i > 0$, if \tcode{const} is in $\cv{}_i^1$ then \tcode{const} is in $\cv{}_i^2$, and similarly for \tcode{volatile}.
290290

291-
\item If the $\text{\cv}_i^1$ and $\text{\cv}_i^2$ are different,
292-
then \tcode{const} is in every $\text{\cv}_k^2$ for $0 < k < i$.
291+
\item If the $\cv{}_i^1$ and $\cv{}_i^2$ are different,
292+
then \tcode{const} is in every $\cv{}_k^2$ for $0 < k < i$.
293293
\end{itemize}
294294

295295
\begin{note}
@@ -507,15 +507,15 @@
507507
\begin{note} The resulting prvalue is not a null pointer value. \end{note}
508508

509509
\pnum
510-
A prvalue of type ``pointer to \cvqual{cv} \tcode{T}'', where \tcode{T}
510+
A prvalue of type ``pointer to \cv{} \tcode{T}'', where \tcode{T}
511511
is an object type, can be converted to a prvalue of type ``pointer to
512-
\cvqual{cv} \tcode{void}''.
512+
\cv{} \tcode{void}''.
513513
The pointer value\iref{basic.compound} is unchanged by this conversion.
514514

515515
\pnum
516-
A prvalue of type ``pointer to \cvqual{cv} \tcode{D}'', where \tcode{D}
516+
A prvalue of type ``pointer to \cv{} \tcode{D}'', where \tcode{D}
517517
is a class type, can be converted to a prvalue of type ``pointer to
518-
\cvqual{cv} \tcode{B}'', where \tcode{B} is a base class\iref{class.derived}
518+
\cv{} \tcode{B}'', where \tcode{B} is a base class\iref{class.derived}
519519
of \tcode{D}. If \tcode{B} is an
520520
inaccessible\iref{class.access} or
521521
ambiguous\iref{class.member.lookup} base class of \tcode{D}, a program
@@ -543,9 +543,9 @@
543543
followed by a qualification conversion\iref{conv.qual}.
544544

545545
\pnum
546-
A prvalue of type ``pointer to member of \tcode{B} of type \cvqual{cv}
546+
A prvalue of type ``pointer to member of \tcode{B} of type \cv{}
547547
\tcode{T}'', where \tcode{B} is a class type, can be converted to
548-
a prvalue of type ``pointer to member of \tcode{D} of type \cvqual{cv}
548+
a prvalue of type ``pointer to member of \tcode{D} of type \cv{}
549549
\tcode{T}'', where \tcode{D} is a derived class\iref{class.derived}
550550
of \tcode{B}. If \tcode{B} is an
551551
inaccessible\iref{class.access},
@@ -556,7 +556,7 @@
556556
member before the conversion took place, but it refers to the base class
557557
member as if it were a member of the derived class. The result refers to
558558
the member in \tcode{D}'s instance of \tcode{B}. Since the result has
559-
type ``pointer to member of \tcode{D} of type \cvqual{cv} \tcode{T}'',
559+
type ``pointer to member of \tcode{D} of type \cv{} \tcode{T}'',
560560
indirection through it with a \tcode{D} object is valid. The result is the same
561561
as if indirecting through the pointer to member of \tcode{B} with the
562562
\tcode{B} subobject of \tcode{D}. The null member pointer value is

source/expressions.tex

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -286,13 +286,13 @@
286286
similar to \tcode{T1} whose cv-qualification signature\iref{conv.qual} is:
287287
\begin{itemize}
288288
\item
289-
for every $i > 0$, $cv^3_i$ is the union of
290-
$cv^1_i$ and $cv^2_i$;
289+
for every $i > 0$, $\cv{}^3_i$ is the union of
290+
$\cv{}^1_i$ and $\cv{}^2_i$;
291291

292292
\item
293-
if the resulting $cv^3_i$ is different from
294-
$cv^1_i$ or $cv^2_i$, then
295-
\tcode{const} is added to every $cv^3_k$ for $0 < k < i$.
293+
if the resulting $\cv{}^3_i$ is different from
294+
$\cv{}^1_i$ or $\cv{}^2_i$, then
295+
\tcode{const} is added to every $\cv{}^3_k$ for $0 < k < i$.
296296
\end{itemize}
297297

298298
\begin{note} Given similar types \tcode{T1} and \tcode{T2}, this
@@ -2455,7 +2455,7 @@
24552455
\pnum
24562456
The left-hand side of the dot operator shall be of scalar type. The
24572457
left-hand side of the arrow operator shall be of pointer to scalar type.
2458-
This scalar type is the object type. The \cvqual{cv}-unqualified
2458+
This scalar type is the object type. The cv-unqualified
24592459
versions of the object type and of the type designated by the
24602460
\grammarterm{pseudo-destructor-name} shall be the same type. Furthermore,
24612461
the two \grammarterm{type-name}{s} in a \grammarterm{pseudo-destructor-name} of
@@ -2575,13 +2575,13 @@
25752575

25762576
\item Otherwise, if \tcode{E1.E2} refers to a non-static member
25772577
function and the type of \tcode{E2} is ``function of
2578-
parameter-type-list \cvqual{cv} \opt{\grammarterm{ref-qualifier}} returning \tcode{T}'', then
2578+
parameter-type-list \cv{} \opt{\grammarterm{ref-qualifier}} returning \tcode{T}'', then
25792579
\tcode{E1.E2} is a prvalue. The expression designates a
25802580
non-static member function. The expression can be used only as the
25812581
left-hand operand of a member function call\iref{class.mfct}.
25822582
\begin{note} Any redundant set of parentheses surrounding the expression
25832583
is ignored\iref{expr.prim}. \end{note} The type of \tcode{E1.E2} is
2584-
``function of parameter-type-list \cvqual{cv} returning \tcode{T}''.
2584+
``function of parameter-type-list \cv{} returning \tcode{T}''.
25852585
\end{itemize}
25862586

25872587
\item If \tcode{E2} is a nested type, the expression \tcode{E1.E2} is
@@ -2658,7 +2658,7 @@
26582658
converting the expression \tcode{v} to type \tcode{T}.
26592659
\indextext{type!incomplete}%
26602660
\tcode{T} shall be a pointer or reference to a complete class type, or
2661-
``pointer to \cvqual{cv} \tcode{void}''. The \tcode{dynamic_cast} operator shall not cast
2661+
``pointer to \cv{} \tcode{void}''. The \tcode{dynamic_cast} operator shall not cast
26622662
away constness\iref{expr.const.cast}.
26632663

26642664
\pnum
@@ -2712,7 +2712,7 @@
27122712
type\iref{class.virtual}.
27132713

27142714
\pnum
2715-
If \tcode{T} is ``pointer to \cvqual{cv} \tcode{void}'', then the result
2715+
If \tcode{T} is ``pointer to \cv{} \tcode{void}'', then the result
27162716
is a pointer to the most derived object pointed to by \tcode{v}.
27172717
Otherwise, a runtime check is applied to see if the object pointed or
27182718
referred to by \tcode{v} can be converted to the type pointed or
@@ -3337,13 +3337,13 @@
33373337
\tcode{T2} has a cv-decomposition of the form
33383338

33393339
\begin{indented}
3340-
$cv_0^2$ $P_0^2$ $cv_1^2$ $P_1^2$ $\cdots$ $cv_{n-1}^2$ $P_{n-1}^2$ $cv_n^2$ $\mathtt{U}_2$,
3340+
$\cv{}_0^2$ $P_0^2$ $\cv{}_1^2$ $P_1^2$ $\cdots$ $\cv{}_{n-1}^2$ $P_{n-1}^2$ $\cv{}_n^2$ $\mathtt{U}_2$,
33413341
\end{indented}
33423342

33433343
and there is no qualification conversion that converts \tcode{T1} to
33443344

33453345
\begin{indented}
3346-
$cv_0^2$ $P_0^1$ $cv_1^2$ $P_1^1$ $\cdots$ $cv_{n-1}^2$ $P_{n-1}^1$ $cv_n^2$ $\mathtt{U}_1$.
3346+
$\cv{}_0^2$ $P_0^1$ $\cv{}_1^2$ $P_1^1$ $\cdots$ $\cv{}_{n-1}^2$ $P_{n-1}^1$ $\cv{}_n^2$ $\mathtt{U}_1$.
33473347
\end{indented}
33483348

33493349
\pnum
@@ -3427,7 +3427,7 @@
34273427
\begin{note}
34283428
\indextext{type!incomplete}%
34293429
Indirection through a pointer to an incomplete type (other than
3430-
\cvqual{cv} \tcode{void}) is valid. The lvalue thus obtained can be
3430+
\cv{} \tcode{void}) is valid. The lvalue thus obtained can be
34313431
used in limited ways (to initialize a reference, for example); this
34323432
lvalue must not be converted to a prvalue, see~\ref{conv.lval}.
34333433
\end{note}
@@ -4622,9 +4622,9 @@
46224622
Otherwise, the expression \tcode{E1} is sequenced before the expression \tcode{E2}.
46234623

46244624
\pnum
4625-
The restrictions on \cvqual{cv-}qualification, and the manner in which
4626-
the \cvqual{cv-}qualifiers of the operands are combined to produce the
4627-
\cvqual{cv-}qualifiers of the result, are the same as the rules for
4625+
The restrictions on cv-qualification, and the manner in which
4626+
the cv-qualifiers of the operands are combined to produce the
4627+
cv-qualifiers of the result, are the same as the rules for
46284628
\tcode{E1.E2} given in~\ref{expr.ref}.
46294629
\begin{note}
46304630
It is not possible to use a pointer to member that refers to a
@@ -5397,9 +5397,9 @@
53975397
Otherwise, if the second and third operand are glvalue bit-fields
53985398
of the same value category and
53995399
of types \cvqual{cv1} \tcode{T} and \cvqual{cv2} \tcode{T}, respectively,
5400-
the operands are considered to be of type \cvqual{cv} \tcode{T}
5400+
the operands are considered to be of type \cv{} \tcode{T}
54015401
for the remainder of this subclause,
5402-
where \cvqual{cv} is the union of \cvqual{cv1} and \cvqual{cv2}.
5402+
where \cv{} is the union of \cvqual{cv1} and \cvqual{cv2}.
54035403

54045404
\pnum
54055405
Otherwise, if the second and third operand have different types and

source/templates.tex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7800,15 +7800,15 @@
78007800
\tcode{A}
78017801
is a type
78027802
\begin{indented}
7803-
$\text{\cv}_{1,0}$ ``pointer to $\ldots$'' $\text{\cv}_{1,n-1}$ ``pointer to''
7804-
$\text{\cv}_{1,n}$ \tcode{T1}
7803+
$\cv{}_{1,0}$ ``pointer to $\ldots$'' $\cv{}_{1,n-1}$ ``pointer to''
7804+
$\cv{}_{1,n}$ \tcode{T1}
78057805
\end{indented}
78067806
and
78077807
\tcode{P}
78087808
is a type
78097809
\begin{indented}
7810-
$\text{\cv}_{2,0}$ ``pointer to $\ldots$'' $\text{\cv}_{2,n-1}$ ``pointer to''
7811-
$\text{\cv}_{2,n}$ \tcode{T2},
7810+
$\cv{}_{2,0}$ ``pointer to $\ldots$'' $\cv{}_{2,n-1}$ ``pointer to''
7811+
$\cv{}_{2,n}$ \tcode{T2},
78127812
\end{indented}
78137813
then the cv-unqualified
78147814
\tcode{T1}

source/utilities.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1681,8 +1681,8 @@
16811681
$\tcode{A}_{ik}$ the following requirements shall be satisfied:
16821682
\begin{itemize}
16831683
\item If $\tcode{T}_i$ is deduced as an lvalue reference type, then
1684-
\tcode{is_constructible_v<$\tcode{A}_{ik}$, $cv_i\;\tcode{A}_{ik}$\&> == true}, otherwise
1685-
\item \tcode{is_constructible_v<$\tcode{A}_{ik}$, $cv_i\;\tcode{A}_{ik}$\&\&> == true}.
1684+
\tcode{is_constructible_v<$\tcode{A}_{ik}$, $\cv{}_i\;\tcode{A}_{ik}$\&> == true}, otherwise
1685+
\item \tcode{is_constructible_v<$\tcode{A}_{ik}$, $\cv{}_i\;\tcode{A}_{ik}$\&\&> == true}.
16861686
\end{itemize}
16871687

16881688
\pnum

0 commit comments

Comments
 (0)