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


1383. Clarifying discarded-value expressions

Section: Clause 7  [expr]     Status: CD3     Submitter: Lawrence Crowl     Date: 2011-08-30

[Moved to DR at the October, 2012 meeting.]

There are some points in the description discarded-value expressions that need clarification:

Suggested resolution:

In some contexts, an expression only appears for its side effects. Such an expression is called a discarded-value expression. The expression is evaluated and its value is discarded. The array-to-pointer (7.3.3 [conv.array]) and function-to-pointer (7.3.4 [conv.func]) standard conversions are not applied. The lvalue-to-rvalue conversion (7.3.2 [conv.lval]) is applied if and only if the expression is an lvalue of volatile-qualified type and it has one of the following forms:

[Note: Expressions invoking user-defined operators are not the operations above. Discarded-value expressions apply to class types, which will be ill-formed if there is no volatile copy constructor with which to initialize the temporary. —end note]

Proposed resolution (February, 2012):

Change Clause 7 [expr] paragraph 10 as follows:

...The lvalue-to-rvalue conversion (7.3.2 [conv.lval]) is applied if and only if the expression is an lvalue of volatile-qualified type and it has is one of the following forms:

[Note: Using an overloaded operator causes a function call; the above covers only operators with built-in meaning. If the lvalue is of class type, it must have a volatile copy constructor to initialize the temporary that is the result of the lvalue-to-rvalue conversion. —end note]

Additional note (February, 2012):

A problem was discovered that was not addressed by the proposed resolution that was reviewed at the February, 2012 meeting, so the issue has been moved back to "review" status with revised wording.