[libcxx-commits] [libcxx] [libcxx] p3008 atomic fp min/max (PR #186716)
via libcxx-commits
libcxx-commits at lists.llvm.org
Sat Mar 21 07:29:02 PDT 2026
================
@@ -0,0 +1,65 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+
+// floating-point-type fetch_max(floating-point-type, memory_order = memory_order::seq_cst) const noexcept;
+
+#include <atomic>
+#include <cassert>
+#include <concepts>
+#include <type_traits>
+#include <utility>
+
+#include "test_macros.h"
+#include "atomic_helpers.h"
+#include "../atomics.types.operations/atomics.types.operations.req/atomic_fetch_fmax_helper.h"
+
+template <typename T>
+concept has_fetch_max = requires(T t) {
+ std::declval<T const>().fetch_max(std::declval<typename T::value_type>());
+ std::declval<T const>().fetch_max(std::declval<typename T::value_type>(), std::declval<std::memory_order>());
+};
+
+template <typename T>
+struct TestDoesNotHaveFetchMax {
----------------
huixie90 wrote:
seems a bit unneccessary to have a `struct` where a simple function would work
https://github.com/llvm/llvm-project/pull/186716
More information about the libcxx-commits
mailing list