This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 116a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-12-19


801. Casting away constness in a cast to rvalue reference type

Section: 7.6.1.11  [expr.const.cast]     Status: CD2     Submitter: UK     Date: 3 March, 2009

N2800 comment UK 58

[Voted into WP at October, 2009 meeting.]

The rules in 7.6.1.11 [expr.const.cast] paragraphs 8 and following, defining “casting away constness,” do not cover a cast to an rvalue reference type.

Proposed resolution (September, 2009):

Change 7.6.1.11 [expr.const.cast] paragraph 9 as follows:

Casting from an lvalue of type T1 to an lvalue of type T2 using a an lvalue reference cast, or casting from an expression of type T1 to an rvalue of type T2 using an rvalue reference cast, casts away constness if a cast from an rvalue of type “pointer to T1” to the type “pointer to T2” casts away constness.