Section: 220.127.116.11 [atomics.types.operations] Status: SG1 Submitter: Alisdair Meredith Opened: 2020-03-19 Last modified: 2020-09-06 13:52:31 UTC
View all other issues in [atomics.types.operations].
View all issues with SG1 status.
Paper P1831R1 aimed to deprecate all the atomic overloads for volatile qualified member function of std::atomic unless is_always_lock_free is true. There are a few omissions in the wording.First, operator++ and operator-- are correctly constrained, but the deprecated overloads are not restored in Annex D, unlike the other member functions. I confirmed with the paper author this is an accidental oversight, and not an intended change of behavior for C++20. Secondly, the wait/notify APIs were added after the initial wording For this paper was drafted, and the paper did not catch up. Again, I confirmed with the paper author that these functions should be similarly constrained and deprecated.
[2020-04-04 Issue Prioritization]
Priority to 3 after reflector discussion. The suggested wording was generally accepted, but there were considerable doubts that it is necessary to add deprecated functions of the new wait/notify functions instead of declaring only the non-volatile overloads. The wish was expressed that both SG1 and LEWG should express their opinion here.
This wording is relative to N4861.
Modify 18.104.22.168 [atomics.types.operations] as indicated:
void wait(T old, memory_order order = memory_order::seq_cst) const volatile noexcept; void wait(T old, memory_order order = memory_order::seq_cst) const noexcept;
-29- Preconditions: […] […]void notify_one() volatile noexcept; void notify_one() noexcept;
-32- Effects: […] […]void notify_all() volatile noexcept; void notify_all() noexcept;
-34- Effects: […] […]
Modify D.30.2 [depr.atomics.volatile], annex D, as indicated:
If an atomic specialization has one of the following overloads, then that overload participates in overload resolution even if atomic<T>::is_always_lock_free is false:void store(T desired, memory_order order = memory_order::seq_cst) volatile noexcept; […] T* fetch_key(ptrdiff_t operand, memory_order order = memory_order::seq_cst) volatile noexcept;