This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 112c. See for the official list.


1758. Explicit conversion in copy/move list initialization

Section:  [over.match.list]     Status: CD4     Submitter: Richard Smith     Date: 2013-09-21

[Moved to DR at the November, 2014 meeting.]

Consider the following example:

  struct X { X(); };
  struct Y { explicit operator X(); } y;
  X x{y};

This appears to be ill-formed, although the corresponding case with parentheses is well-formed. There seem to be two factors that prevent this from being accepted:

First, the special provision allowing an explicit conversion function to be used when initializing the parameter of a copy/move constructor is in [over.match.copy], and this case takes us to [over.match.list] instead.

Second, [] paragraph 4 says that in this case, because we are in [over.match.list], and we have a single argument, and we are calling a copy/move constructor, we are not allowed to consider a user-defined conversion sequence for the argument.

Similarly, in an example like

  struct A {
   A() {}
   A(const A &) {}
  struct B {
   operator A() { return A(); }
  } b;
  A a{b};

the wording in [] paragraph 4 with regard to [over.match.list] prevents considering B's conversion function when initializing the first parameter of A's copy constructor, thereby making this code ill-formed.

Notes from the February, 2014 meeting:

This issue should be addressed by the eventual resolution of issue 1467.

Proposed resolution (June, 2014):

This issue is resolved by the resolution of issue 1467.