Skip to content

Commit

Permalink
Add atomic& operator=(const atomic&) volatile = delete;
Browse files Browse the repository at this point in the history
  • Loading branch information
frederick-vs-ja committed Dec 24, 2023
1 parent a888880 commit 59b7141
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
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
4 changes: 0 additions & 4 deletions tests/libcxx/expected_results.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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<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

0 comments on commit 59b7141

Please sign in to comment.