Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<atomic>: Add missing atomic& operator=(const atomic&) volatile = delete; overload #4287

Merged
merged 1 commit into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions stl/inc/atomic
Original file line number Diff line number Diff line change
Expand Up @@ -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<sizeof(_Ty)>;
Expand Down
7 changes: 0 additions & 7 deletions tests/libcxx/expected_results.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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<volatile std::atomic<T>&, const std::atomic<T>&>'
# 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[]'
Expand Down