[libcxx-commits] [libcxx] [libc++] Implement P0493R5: Atomic minimum/maximum (PR #180333)
via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Feb 16 05:09:18 PST 2026
================
@@ -0,0 +1,76 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// REQUIRES: std-at-least-c++26
+// XFAIL: !has-64-bit-atomics
+
+// integral-type fetch_max(integral-type, memory_order = memory_order::seq_cst) const noexcept;
+
+#include <atomic>
+#include <cassert>
+#include <concepts>
+#include <type_traits>
+#include <utility>
+
+#include "atomic_helpers.h"
+#include "test_macros.h"
+
+template <typename T>
+concept has_fetch_max = requires {
----------------
huixie90 wrote:
i think this concept isn't defined correctly, which probably means that the test is passing silently. Usually for this kind of helper concept, we add a "positive" case of `static_assert` to make sure the concept is defined properly.
For example
```cpp
static_assert(has_fetch_max<std::atomic_ref<int>>);
```
https://github.com/llvm/llvm-project/pull/180333
More information about the libcxx-commits
mailing list