<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 978</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="978"></A><H4>978.
  
Incorrect specification for copy initialization
</H4>
<B>Section: </B>12.2.4.2&#160; [<A href="https://wg21.link/over.best.ics">over.best.ics</A>]
 &#160;&#160;&#160;

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

 <B>Submitter: </B>Daniel Kr&#252;gler
 &#160;&#160;&#160;

 <B>Date: </B>5 October, 2009<BR>


<P>[Voted into WP at March, 2010 meeting.]</P>



<P>12.2.4.2 [<A href="https://wg21.link/over.best.ics#4">over.best.ics</A>] paragraph 4 says,</P>

<BLOCKQUOTE>

However, when considering the argument of a user-defined conversion
function that is a candidate by 12.2.2.4 [<A href="https://wg21.link/over.match.ctor">over.match.ctor</A>] when
invoked for the copying of the temporary in the second step of a class
copy-initialization, by 12.2.2.8 [<A href="https://wg21.link/over.match.list">over.match.list</A>] when passing the
initializer list as a single argument or when the initializer list has
exactly one element and a conversion to some class <TT>X</TT> or
reference to (possibly cv-qualified) <TT>X</TT> is considered for the
first parameter of a constructor of <TT>X</TT>, or by 12.2.2.5 [<A href="https://wg21.link/over.match.copy">over.match.copy</A>], 12.2.2.6 [<A href="https://wg21.link/over.match.conv">over.match.conv</A>], or 12.2.2.7 [<A href="https://wg21.link/over.match.ref">over.match.ref</A>] in all cases, only standard conversion sequences and
ellipsis conversion sequences are allowed.

</BLOCKQUOTE>

<P>This is not quite right, as this applies to constructor
arguments, not just arguments of user-defined conversion
functions.  Furthermore, the word &#8220;allowed&#8221; might
be better replaced by something like,</P>

<BLOCKQUOTE>

considered (in particular, for the purposes of determining
whether the candidate function (that is either a constructor
or a conversion function) is viable)

</BLOCKQUOTE>

<P><B>Proposed resolution (October, 2009):</B></P>

<P>Change 12.2.4.2 [<A href="https://wg21.link/over.best.ics#4">over.best.ics</A>] paragraph 4 as follows:</P>

<BLOCKQUOTE>

However, when considering the argument of a <INS>constructor or</INS>
user-defined conversion function that is a candidate by 12.2.2.4 [<A href="https://wg21.link/over.match.ctor">over.match.ctor</A>] when invoked for the copying of the temporary in the
second step of a class copy-initialization, by 12.2.2.8 [<A href="https://wg21.link/over.match.list">over.match.list</A>] when passing the initializer list as a single
argument or when the initializer list has exactly one element and a
conversion to some class <TT>X</TT> or reference to (possibly
cv-qualified) <TT>X</TT> is considered for the first parameter of a
constructor of <TT>X</TT>, or by 12.2.2.5 [<A href="https://wg21.link/over.match.copy">over.match.copy</A>],
12.2.2.6 [<A href="https://wg21.link/over.match.conv">over.match.conv</A>], or 12.2.2.7 [<A href="https://wg21.link/over.match.ref">over.match.ref</A>] in all
cases, only standard conversion sequences and ellipsis conversion
sequences are <DEL>allowed</DEL> <INS>considered</INS>.

</BLOCKQUOTE>

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