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

2024-09-25


2427. Deprecation of volatile operands and unevaluated contexts

Section: 7.6.19  [expr.ass]     Status: C++20     Submitter: Mike Miller     Date: 2019-08-14

[Adopted as a DR at the November, 2019 meeting.]

According to 7.6.19 [expr.ass] paragraph 7,

A simple assignment whose left operand is of a volatile -qualified non-class type is deprecated (D.4 [depr.volatile.type]) unless the assignment is either a discarded-value expression or appears in an unevaluated context.

The deprecations of increment, decrement, and compound assignment operators do not, but presumably should, mention unevaluated contexts.

Notes from the August, 2019 teleconference:

The omission of those operators was intentional; the deprecation is intended only to affect cases where using the result of the operation would result in a subsequent fetch of the value. However, some shortcomings of the existing wording were noted and will be addressed in the resolution.

Proposed resolution (October, 2019):

Change 7.6.19 [expr.ass] paragraph 5 as follows:

A simple assignment whose left operand is of a volatile-qualified type is deprecated (D.4 [depr.volatile.type]) unless the (possibly parenthesized) assignment is either a discarded-value expression or appears in an unevaluated context operand.