Created on 2009-05-09.00:00:00 last changed 190 months ago
[Voted into WP at October, 2009 meeting.]
Proposed resolution (September, 2009):
This issue is resolved by the resolution of issue 656.
Consider the following example:
struct A { } a;
struct B {
operator A&&() {
return static_cast<A&&>(a);
}
};
A&& r = B();
One would expect that r would be bound to the object returned by B::operator A&&(), i.e., a. However, the logic in 9.5.4 [dcl.init.ref] paragraph 5 requires that the result of the conversion function be copied to a temporary and r bound to the temporary.
Probably the way to address this is to add another top-level bullet between the first and second that would essentially mimic the first bullet except dealing with rvalue references: direct binding to reference-compatible rvalues or to the reference-compatible result of a conversion function. (Note that this should only apply to class rvalues; the creation of a temporary for non-class rvalues is necessary to have an object for the reference to bind to.)
(See also issue 656.)
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2010-03-29 00:00:00 | admin | set | status: dr -> cd2 |
| 2009-11-08 00:00:00 | admin | set | messages: + msg2461 |
| 2009-11-08 00:00:00 | admin | set | status: tentatively ready -> dr |
| 2009-09-29 00:00:00 | admin | set | messages: + msg2300 |
| 2009-09-29 00:00:00 | admin | set | status: drafting -> tentatively ready |
| 2009-08-03 00:00:00 | admin | set | status: open -> drafting |
| 2009-05-09 00:00:00 | admin | create | |