From 59b714120af109eefde04aa68bda22cfca4c156b Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Sun, 24 Dec 2023 23:39:11 +0800 Subject: [PATCH] Add `atomic& operator=(const atomic&) volatile = delete;` --- stl/inc/atomic | 5 +++-- tests/libcxx/expected_results.txt | 4 ---- 2 files changed, 3 insertions(+), 6 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..820d7bc5d91 100644 --- a/tests/libcxx/expected_results.txt +++ b/tests/libcxx/expected_results.txt @@ -1227,10 +1227,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[]'