Created on 2022-11-03.00:00:00 last changed 16 months ago
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; //deprecatedOKbrachiosaur = brachiosaur + neck; // OKbrachiosaur |= neck; // OK, bitwise compound expression
[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:43 | admin | set | status: open -> c++23 |
2023-07-16 13:00:43 | admin | set | status: drwp -> open |
2023-02-18 18:43:04 | admin | set | status: dr -> drwp |
2022-11-25 05:14:04 | admin | set | status: nb -> dr |
2022-11-08 20:32:09 | admin | set | status: open -> nb |
2022-11-08 20:32:09 | admin | set | status: open -> open |
2022-11-08 20:32:09 | admin | set | status: open -> open |
2022-11-08 20:32:09 | admin | set | status: open -> open |
2022-11-08 20:32:09 | admin | set | messages: + msg6988 |
2022-11-08 14:30:58 | admin | set | status: nb -> open |
2022-11-08 14:30:58 | admin | set | status: nb -> nb |
2022-11-08 14:30:58 | admin | set | status: nb -> nb |
2022-11-03 00:00:00 | admin | create |