Title
memory_order::memory_order_foo broken in C++20
Status
nad
Section
[atomics.order]
Submitter
Eric Fiselier

Created on 2019-08-31.00:00:00 last changed 2 weeks ago

Messages

Date: 2026-06-15.13:21:36

Proposed resolution:

This wording is relative to N4830.

  1. Add a new sub-clause at the end of Clause [depr] as indicated:

    D.?? Deprecated memory_order enumerators

    -?- The following enumerators are declared in addition to those specified in [atomics.order]:

    namespace std {
      enum class memory_order : unspecified {
        memory_order_relaxed = relaxed, memory_order_consume = consume, memory_order_acquire = acquire, 
        memory_order_release = release, memory_order_acq_rel = acq_rel, memory_order_seq_cst = seq_cst
      };
    }
    
Date: 2026-06-15.13:21:36

[ Brno 2026-06-12; Status changed: New → NAD. ]

LWG noted that two major implementations have removed these enumerators. One of them reported that they have not received any reports relating to this removal after 8 years. LWG does not believe that it is necessary to re-add these names to the standard.

Date: 2019-10-07.02:21:30

[ 2019-10 Priority set to 4 after reflector discussion ]

Date: 2019-08-31.00:00:00

P0439R0 renamed the std::memory_order enumerators when making it a scoped enumeration. The paper makes the old unscoped names available in the global namespace, but not within the scope of the enumeration.

For example:

std::memory_order::memory_order_consume is no longer well-formed but std::memory_order::consume and std::memory_order_consume are.

In order to prevent unnecessary breakage, we should re-add the memory_order_foo names to the enumeration.

History
Date User Action Args
2026-06-15 13:21:36adminsetmessages: + msg16448
2026-06-15 13:21:36adminsetstatus: new -> nad
2019-10-07 02:21:30adminsetmessages: + msg10675
2019-08-31 16:52:58adminsetmessages: + msg10592
2019-08-31 00:00:00admincreate