<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 2898</TITLE>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<STYLE TYPE="text/css">
  INS { text-decoration:none; font-weight:bold; background-color:#A0FFA0 }
  .INS { text-decoration:none; background-color:#D0FFD0 }
  DEL { text-decoration:line-through; background-color:#FFA0A0 }
  .DEL { text-decoration:line-through; background-color: #FFD0D0 }
  @media (prefers-color-scheme: dark) {
    HTML { background-color:#202020; color:#f0f0f0; }
    A { color:#5bc0ff; }
    A:visited { color:#c6a8ff; }
    A:hover, a:focus { color:#afd7ff; }
    INS { background-color:#033a16; color:#aff5b4; }
    .INS { background-color: #033a16; }
    DEL { background-color:#67060c; color:#ffdcd7; }
    .DEL { background-color:#67060c; }
  }
  SPAN.cmnt { font-family:Times; font-style:italic }
</STYLE>
</HEAD>
<BODY>
<P><EM>This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21
  Core Issues List revision 118b.
  See http://www.open-std.org/jtc1/sc22/wg21/ for the official
  list.</EM></P>
<P>2025-09-28</P>
<HR>
<A NAME="2898"></A><H4>2898.
  
Clarify implicit conversion sequence from <I>cv</I> <TT>T</TT> to <TT>T</TT>
</H4>
<B>Section: </B>12.2.4.2.1&#160; [<A href="https://wg21.link/over.best.ics.general">over.best.ics.general</A>]
 &#160;&#160;&#160;

 <B>Status: </B>CD7
 &#160;&#160;&#160;

 <B>Submitter: </B>Brian Bi
 &#160;&#160;&#160;

 <B>Date: </B>2024-05-30<BR>


<P>[Accepted as a DR at the June, 2025 meeting.]</P>

<P>(From submission
<A HREF="https://github.com/cplusplus/CWG/issues/544">#544</A>.)</P>

<P>Subclause 12.2.4.2.1 [<A href="https://wg21.link/over.best.ics.general#7">over.best.ics.general</A>] paragraph 7 specifies:</P>

<BLOCKQUOTE>

When the parameter has a class type and the argument expression has
the same type, the implicit conversion sequence is an identity
conversion. When the parameter has a class type and the argument
expression has a derived class type, the implicit conversion sequence
is a derived-to-base conversion from the derived class to the base
class. A derived-to-base conversion has Conversion rank
(12.2.4.2.2 [<A href="https://wg21.link/over.ics.scs">over.ics.scs</A>]).

</BLOCKQUOTE>

<P>Does "the same type" imply that differences in cv-qualification are
significant?  12.2.4.2.1 [<A href="https://wg21.link/over.best.ics.general#6">over.best.ics.general</A>] paragraph 6 appears to
differ:</P>

<BLOCKQUOTE>

... Any difference in top-level cv-qualification is subsumed by the
initialization itself and does not constitute a conversion. [Example
2: A parameter of type A can be initialized from an argument of type
const A. The implicit conversion sequence for that case is the
identity sequence; it contains no "conversion" from const A to A. --
end example]

</BLOCKQUOTE>

<P>The example appears to reflect the intent; the normative wording
should be clarified.</P>

<P><B>Proposed resolution (no objections during CWG reflector review starting 2025-03-11):</B></P>

<OL>
<LI>
<P>Change in 12.2.4.2.1 [<A href="https://wg21.link/over.best.ics.general#6">over.best.ics.general</A>] paragraph 6, moving the
amended example to paragraph 7:</P>

<BLOCKQUOTE>

... <DEL>Any difference in top-level cv-qualification is subsumed by the
initialization itself and does not constitute a conversion. [Example
2: A parameter of type A can be initialized from an argument of type
const A. The implicit conversion sequence for that case is the
identity sequence; it contains no "conversion" from const A to A. --
end example]</DEL>

</BLOCKQUOTE>
</LI>

<LI>
<P>Change in 12.2.4.2.1 [<A href="https://wg21.link/over.best.ics.general#7">over.best.ics.general</A>] paragraph 7 as follows:</P>

<BLOCKQUOTE>

When <DEL>the parameter has a class type and the argument expression
has the same type</DEL> <INS>the cv-unqualified version of the type of
the argument expression is the same as the parameter type</INS>, the
implicit conversion sequence is an identity conversion. When the
parameter has a class type and the argument expression has
a <INS>(possibly cv-qualified)</INS> derived class type, the implicit
conversion sequence is a derived-to-base conversion from the derived
class to the base class. A derived-to-base conversion has Conversion
rank (12.2.4.2.2 [<A href="https://wg21.link/over.ics.scs">over.ics.scs</A>]).
<INS>[Example: An implicit conversion sequence from an argument of
type const A to a parameter of type A can be formed, even if overload
resolution for copy-initialization of A from the argument would not
find a viable function (12.2.2.4 [<A href="https://wg21.link/over.match.ctor">over.match.ctor</A>],
12.2.3 [<A href="https://wg21.link/over.match.viable">over.match.viable</A>]). The implicit conversion sequence for
that case is the identity sequence; it contains no "conversion" from
const A to A. -- end example]</INS>
</BLOCKQUOTE>
</LI>
</OL>

<BR><BR>
</BODY>
</HTML>
