From acd6c3408e52a792237c1eef8cb5183013edd132 Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Mon, 25 Dec 2023 07:24:46 +0800 Subject: [PATCH] Add `atomic& operator=(const atomic&) volatile = delete;` --- stl/inc/atomic | 5 +++-- tests/libcxx/expected_results.txt | 7 ------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/stl/inc/atomic b/stl/inc/atomic index 93aa9794f72..8161a9981a1 100644 --- a/stl/inc/atomic +++ b/stl/inc/atomic @@ -2155,8 +2155,9 @@ public: constexpr atomic() noexcept(is_nothrow_default_constructible_v<_Ty>) : _Base() {} - atomic(const atomic&) = delete; - atomic& operator=(const atomic&) = delete; + atomic(const atomic&) = delete; + atomic& operator=(const atomic&) = delete; + atomic& operator=(const atomic&) volatile = delete; #if _HAS_CXX17 static constexpr bool is_always_lock_free = _Is_always_lock_free; diff --git a/tests/libcxx/expected_results.txt b/tests/libcxx/expected_results.txt index aa7119f94a3..480e535e972 100644 --- a/tests/libcxx/expected_results.txt +++ b/tests/libcxx/expected_results.txt @@ -350,9 +350,6 @@ std/thread/futures/futures.promise/set_value_at_thread_exit_const.pass.cpp FAIL std/thread/futures/futures.promise/set_value_at_thread_exit_void.pass.cpp FAIL std/thread/futures/futures.task/futures.task.members/make_ready_at_thread_exit.pass.cpp FAIL -# libc++ speculatively implements LWG-3633 "Atomics are copy constructible and copy assignable from volatile atomics" -std/atomics/atomics.types.generic/copy_semantics_traits.pass.cpp FAIL - # *** C1XX COMPILER BUGS *** # DevCom-409222 VSO-752709 "Constructing rvalue reference from non-reference-related lvalue reference" @@ -1227,10 +1224,6 @@ std/ranges/range.adaptors/range.split/general.pass.cpp:1 FAIL std/strings/char.traits/char.traits.specializations/char.traits.specializations.char/compare.pass.cpp:0 FAIL std/strings/char.traits/char.traits.specializations/char.traits.specializations.char/compare.pass.cpp:1 FAIL -# Not analyzed. static_assert failed: '!std::is_assignable_v&, const std::atomic&>' -# The Standard depicts `atomic& operator=(const atomic&) volatile = delete;` which we seem to be missing. -std/atomics/atomics.types.generic/atomics.types.float/copy.compile.pass.cpp FAIL - # Not analyzed. # MSVC error C2087: 'abstract declarator': missing subscript # Clang error: array has incomplete element type 'int[]'