Skip to content

Commit 4a8d7b5

Browse files
burblebeetkoeppe
authored andcommitted
CWG2895 Initialization should ignore the destination type's cv-qualification
1 parent cc7fbf6 commit 4a8d7b5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

source/declarations.tex

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4710,7 +4710,7 @@
47104710
The
47114711
\indextext{type!destination}%
47124712
\term{destination type}
4713-
is the type of the object or reference being initialized and the
4713+
is the cv-unqualified type of the object or reference being initialized and the
47144714
\term{source type}
47154715
is the type of the initializer expression.
47164716
If the initializer is not a single (possibly parenthesized) expression, the
@@ -4771,21 +4771,21 @@
47714771
is sequenced before those associated with
47724772
the initialization of the $j^\text{th}$ element.
47734773
\item
4774-
Otherwise, if the destination type is a (possibly cv-qualified) class type:
4774+
Otherwise, if the destination type is a class type:
47754775

47764776
\begin{itemize}
47774777
\item
47784778
If the initializer expression is a prvalue
47794779
and the cv-unqualified version of the source type
4780-
is the same class as the class of the destination,
4780+
is the same as the destination type,
47814781
the initializer expression is used to initialize the destination object.
47824782
\begin{example}
47834783
\tcode{T x = T(T(T()));} value-initializes \tcode{x}.
47844784
\end{example}
47854785
\item
47864786
Otherwise, if the initialization is direct-initialization,
47874787
or if it is copy-initialization where the cv-unqualified version of the source
4788-
type is the same class as, or a derived class of, the class of the destination,
4788+
type is the same as or is derived from the class of the destination type,
47894789
constructors are considered.
47904790
The applicable constructors
47914791
are enumerated\iref{over.match.ctor}, and the best one is chosen
@@ -4882,7 +4882,7 @@
48824882
the (possibly converted) value of the initializer expression.
48834883
A standard conversion sequence\iref{conv} is used
48844884
to convert the initializer expression to
4885-
a prvalue of the cv-unqualified version of
4885+
a prvalue of
48864886
the destination type;
48874887
no user-defined conversions are considered.
48884888
If the conversion cannot

0 commit comments

Comments
 (0)