This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 119a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2025-12-20
[Moved to DR at the October, 2012 meeting.]
7.6.1.10 [expr.reinterpret.cast] paragraph 11, dealing with casting toreference types, only allows an lvalue operand. Presumably it shouldallow a glvalue operand when the target is an rvalue reference type.
Proposed resolution (August, 2011):
Change 7.6.1.10 [expr.reinterpret.cast] paragraph 11:
An lvalueA glvalue expression of typeT1 can be cast to the type “reference toT2” if an expression of type “pointer toT1” can be explicitly converted to the type“pointer toT2” using areinterpret_cast.The result refers to the same objectas the source glvalue, but with the specifiedtype. [Note: That is,for lvalues, a referencecastreinterpret_cast<T&>(x) has the same effect asthe conversion*reinterpret_cast<T*>(&x) with thebuilt-in & and * operators (and similarly forreinterpret_cast<T&&>(x)).—endnote]The result refers to the same object as the sourcelvalue, but with a different type. The result is an lvalue for anlvalue reference type or an rvalue reference to function type and anxvalue for an rvalue reference to object type.No temporary iscreated,...
Additional note, January, 2012:
An objection has been raised to the proposed resolution on thebasis that it unnecessarily weakens the distinction between rvaluesand lvalues, making it easier to create dangling references. Itsstatus has therefore been changed back to "review" to allow furtherdiscussion.