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

2023-02-07


53. Lvalue-to-rvalue conversion before certain static_casts

Section: 7.6.1.9  [expr.static.cast]     Status: TC1     Submitter: Steve Adamczyk     Date: 13 Oct 1998

Section 7.6.1.9 [expr.static.cast] paragraph 6 should make it clear that when any of the "inverse of any standard conversion sequence" static_casts are done, the operand undergoes the lvalue-to-rvalue conversions first.

Proposed Resolution (10/00):

In 7.6.1.9 [expr.static.cast] paragraph 6, change

can be performed explicitly using static_cast subject to the restriction that the explicit conversion does not cast away constness (7.6.1.11 [expr.const.cast]), ...

to

can be performed explicitly using static_cast. The lvalue-to-rvalue (7.3.2 [conv.lval]), array-to-pointer (7.3.3 [conv.array]), and function-to-pointer (7.3.4 [conv.func]) conversions are applied to the operand. Such a static_cast is subject to the restriction that it does not cast away constness (7.6.1.11 [expr.const.cast]), ...