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


2028. Converting constructors in rvalue reference initialization

Section:  [over.match.ref]     Status: drafting     Submitter: Mitsuru Kariya     Date: 2014-10-25

Consider the following example:

  struct T {
    T() {}
    T(struct S&) {}

  struct S {
    operator T() { return T(); }

  int main()
    S s;
    T&& t(s);  // #1

Because there are two possible conversions from S to T, one by conversion function and the other by converting constructor, one might expect that the initialization at #1 would be ambiguous. However, [over.match.ref] (used in the relevant bullet of 9.4.4 [dcl.init.ref], paragraph only deals with conversion functions and ignores converting constructors.

Notes from the November, 2014 meeting:

CWG agreed that 9.4.4 [dcl.init.ref] should be changed to consider converting constructors in this case.