Date
2011-01-15.00:00:00
Message id
3081

Content

Proposed resolution (January, 2011):

  1. Add a new paragraph after Clause 7 [expr] paragraph 10:

  2. 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 only if the expression is an lvalue of volatile-qualified type and it has one of the following forms:

    • id-expression (_N4567_.5.1.1 [expr.prim.general]),

    • subscripting (7.6.1.2 [expr.sub]),

    • class member access (7.6.1.5 [expr.ref]),

    • indirection (7.6.2.2 [expr.unary.op]),

    • pointer-to-member operation (7.6.4 [expr.mptr.oper]),

    • conditional expression (7.6.16 [expr.cond]) where both the second and the third operand are one of the above, or

    • comma expression (7.6.20 [expr.comma]) where the right operand is one of the above.

  3. Change 7.6.1.9 [expr.static.cast] paragraph 6 as follows:

  4. Any expression can be explicitly converted to type cv void, in which case it becomes a discarded-value expression (Clause 7 [expr]). The expression value is discarded. [Note: however, if the value is in a temporary object (6.7.7 [class.temporary]), the destructor for that object is not executed until the usual time, and the value of the object is preserved for the purpose of executing the destructor. —end note] 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 not applied to the expression.
  5. Change 7.6.20 [expr.comma] paragraph 1 as follows:

  6. ...A pair of expressions separated by a comma is evaluated left-to-right; and the value of the left expression is discarded a discarded-value expression (Clause 7 [expr]).83 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 not applied to the left expression. Every value computation...
  7. Change 8.3 [stmt.expr] paragraph 1 as follows:

  8. ...The expression is evaluated and its value is discarded a discarded-value expression (Clause 7 [expr]). 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 not applied to the expression. All side effects...