Title
Un-deprecation of compound volatile assignments
Status
c++23
Section
7.6.19 [expr.ass]
Submitter
US

Created on 2022-11-03.00:00:00 last changed 17 months ago

Messages

Date: 2022-11-08.20:32:09

Proposed resolution (approved by CWG 2022-11-08):

Change in 7.6.19 [expr.ass] paragraph 6 as follows:

The behavior of an expression of the form E1 op= E2 is equivalent to E1 = E1 op E2 except that E1 is evaluated only once. [ Note: The object designated by E1 is accessed twice. -- end note ] Such expressions are deprecated if E1 has volatile-qualified type and op is not one of the bitwise operators |, &, ^; see D.5.

Change in D.4 [depr.volatile.type] paragraph 2 as follows:

  brachiosaur += neck;                // deprecatedOK
  brachiosaur = brachiosaur + neck;   // OK
  brachiosaur |= neck;                // OK, bitwise compound expression
Date: 2022-11-27.21:00:25
P2720R0 comment USĀ 16-045

[Accepted as a DR at the November, 2022 meeting.]

Many functions of volatile were deprecated in C++20. In C++23, volatile compound operations were de-deprecated by P2327. The rationale for this de-deprecation is lacking.

Deprecation is not removal. P2327 in C++23 is stopping the change that we began with C++20, mere moments ago if counting by adoption time. It primarily argued that it's an inconvenient change, and that some of the audience would just not cooperate with WG21's indicated direction, so WG21 should compromise the technical consistency of the Standard so they could continue to not cooperate.

The paper did not bring new information on the technical merits of the case, and net the result of applying it was a technically dissonant Standard specification --- a strictly worse specification than C++20. Bitwise compound operations are not special for any technical reason, they are only special because making them special shields some from deprecation diagnostics.

EWG 2022-11-07

Contrary to the direction desired in the NB comment, EWG resolved to un-deprecate all volatile compound assignments.

History
Date User Action Args
2023-07-16 13:00:43adminsetstatus: open -> c++23
2023-07-16 13:00:43adminsetstatus: drwp -> open
2023-02-18 18:43:04adminsetstatus: dr -> drwp
2022-11-25 05:14:04adminsetstatus: nb -> dr
2022-11-08 20:32:09adminsetstatus: open -> nb
2022-11-08 20:32:09adminsetstatus: open -> open
2022-11-08 20:32:09adminsetstatus: open -> open
2022-11-08 20:32:09adminsetstatus: open -> open
2022-11-08 20:32:09adminsetmessages: + msg6988
2022-11-08 14:30:58adminsetstatus: nb -> open
2022-11-08 14:30:58adminsetstatus: nb -> nb
2022-11-08 14:30:58adminsetstatus: nb -> nb
2022-11-03 00:00:00admincreate