This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of WP status.

3671. atomic_fetch_xor missing from stdatomic.h

Section: 33.5.12 [stdatomic.h.syn] Status: WP Submitter: Hubert Tong Opened: 2022-02-09 Last modified: 2022-07-25

Priority: Not Prioritized

View all issues with WP status.

Discussion:

C17 subclause 7.17.7.5 provides atomic_fetch_xor and atomic_fetch_xor_explicit. stdatomic.h in the working draft (N4901) does not.

[2022-02-09; Jonathan comments and provides wording]

C++20 33.5.2 [atomics.syn] has both of them, too, so it should definitely be in the common subset.

[2022-03-04; Reflector poll]

Set status to Tentatively Ready after eight votes in favour during reflector poll.

[2022-07-15; LWG telecon: move to Ready]

[2022-07-25 Approved at July 2022 virtual plenary. Status changed: Ready → WP.]

Proposed resolution:

This wording is relative to N4901.

  1. Modify 33.5.12 [stdatomic.h.syn], header <stdatomic.h> synopsis, as indicated:

    [Drafting Note: The editor is kindly requested to reorder these "atomic_fetch_KEY" declarations to match the other synopses in Clause 33.5 [atomics]: add, sub, and, or, xor.]

    […]
    using std::atomic_fetch_or;                    // see below
    using std::atomic_fetch_or_explicit;           // see below
    using std::atomic_fetch_xor;                   // see below
    using std::atomic_fetch_xor_explicit;          // see below
    using std::atomic_fetch_and;                   // see below
    using std::atomic_fetch_and_explicit;          // see below
    […]