[libcxx-commits] [libcxx] [libcxx] p3111 initial implementation (PR #186935)

Damien L-G via libcxx-commits libcxx-commits at lists.llvm.org
Mon Mar 23 09:49:23 PDT 2026


================
@@ -0,0 +1,95 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20, c++23
+// XFAIL: !has-64-bit-atomics
+
+// <atomic>
+
+// Test atomic_ref<T> member functions:
+//   store_add, store_sub, store_and, store_or, store_xor
+//
+// void store_add(T operand, memory_order order = memory_order::seq_cst) const noexcept;
+// (Same pattern for store_sub, store_and, store_or, store_xor)
+
+#include <atomic>
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+#include "atomic_helpers.h"
+#include "../atomics.types.operations/atomics.types.operations.req/atomic_store_operations_helper.h"
+
----------------
dalg24 wrote:

I understand the intent to reuse testing facilities between atomic and atomic_ref, but the current approach lacks our detecting that some of the atomic_ref specializations do not have these member functions and does not include tests that perform concurrent operations.
I would prefer if we follow the style of other atomic_ref tests.

https://github.com/llvm/llvm-project/pull/186935


More information about the libcxx-commits mailing list