Created on 2013-09-21.00:00:00 last changed 95 months ago
[Moved to DR at the November, 2014 meeting.]
Proposed resolution (June, 2014):
This issue is resolved by the resolution of issue 1467.
Notes from the February, 2014 meeting:
This issue should be addressed by the eventual resolution of issue 1467.
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 12.2.2.5 [over.match.copy], and this case takes us to 12.2.2.8 [over.match.list] instead.
Second, 12.2.4.2 [over.best.ics] paragraph 4 says that in this case, because we are in 12.2.2.8 [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 12.2.4.2 [over.best.ics] paragraph 4 with regard to 12.2.2.8 [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.
History | |||
---|---|---|---|
Date | User | Action | Args |
2017-02-06 00:00:00 | admin | set | status: drwp -> cd4 |
2015-05-25 00:00:00 | admin | set | status: dr -> drwp |
2015-04-13 00:00:00 | admin | set | messages: + msg5403 |
2014-11-24 00:00:00 | admin | set | status: ready -> dr |
2014-07-07 00:00:00 | admin | set | messages: + msg5073 |
2014-07-07 00:00:00 | admin | set | status: open -> ready |
2014-03-03 00:00:00 | admin | set | messages: + msg4916 |
2013-09-21 00:00:00 | admin | create |