CWG Issue 1560 (original) (raw)
This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 118e. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2025-11-05
1560. Gratuitous lvalue-to-rvalue conversion in conditional-expression with throw-expression operand
Section: 7.6.16 [expr.cond]Status: CD3Submitter: Nikolay IvchenkovDate: 2012-09-04
[Moved to DR at the April, 2013 meeting.]
A glvalue appearing as one operand of a _conditional-expression_in which the other operand is a throw-expression is converted to a prvalue, regardless of how the conditional-expression is used:
If either the second or the third operand has type void, then 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]) standard conversions are performed on the second and third operands, and one of the following shall hold:
- The second or the third operand (but not both) is a_throw-expression_ (14.2 [except.throw]); the result is of the type of the other and is a prvalue.
This seems to be gratuitous and surprising.
Proposed resolution (October, 2012):
This issue is resolved by the resolution ofissue 1550.