This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 118e. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2025-11-05
[Moved to DR at 4/01 meeting.]
The description of copy-initialization in 9.5 [dcl.init] paragraph 14says:
struct A { A(A&); }; struct B : A { }; struct C { operator B&(); }; C c; const A a = c; // allowed?The temporary created with the conversion function is an lvalue of typeB. If the temporary must have the cv-qualifiers of the destinationtype (i.e. const) then the copy-constructor forA cannot be calledto create the object of typeA from the lvalue of typeconstB. If the temporary has the cv-qualifiers of the result type of theconversion function, then the copy-constructor forA can be calledto create the object of typeA from the lvalue of typeconstB. This last outcome seems more appropriate.
Steve Adamczyk:
Because of late changes to this area, therelevant text is now the third sub-bullet of the fourth bullet of9.5 [dcl.init] paragraph 14:
Otherwise (i.e., for the remaining copy-initialization cases),user-defined conversion sequences that can convert from the sourcetype to the destination type or (when a conversion function is used)to a derived class thereof are enumerated...The function selected is called with the initializer expression as itsargument; if the function is a constructor, the call initializes atemporary of the destination type. The result of the call (which isthe temporary for the constructor case) is then used todirect-initialize, according to the rules above, the object that isthe destination of the copy-initialization.
The issue still remains whether the wording should refer to "thecv-unqualified version of the destination type." I think itshould.
Notes from 10/00 meeting:
The original example does not illustrate the remainingproblem. The following example does:
struct C { }; C c; struct A { A(const A&); A(const C&); }; const volatile A a = c; // OkayProposed Resolution (04/01):
In 9.5 [dcl.init], paragraph 14, bullet 4,sub-bullet 3, change
if the function is a constructor, the call initializes a temporaryof the destination type.
to
if the function is a constructor, the call initializes a temporaryof the cv-unqualified version of the destination type.