diff --git a/libcxx/include/__bit_reference b/libcxx/include/__bit_reference --- a/libcxx/include/__bit_reference +++ b/libcxx/include/__bit_reference @@ -65,6 +65,16 @@ return *this; } +#if _LIBCPP_STD_VER > 20 + _LIBCPP_HIDE_FROM_ABI const __bit_reference& operator=(bool __x) const noexcept { + if (__x) + *__seg_ |= __mask_; + else + *__seg_ &= ~__mask_; + return *this; + } +#endif + _LIBCPP_INLINE_VISIBILITY __bit_reference& operator=(const __bit_reference& __x) _NOEXCEPT {return operator=(static_cast(__x));} diff --git a/libcxx/test/std/containers/sequences/vector.bool/iterator_concept_conformance.compile.pass.cpp b/libcxx/test/std/containers/sequences/vector.bool/iterator_concept_conformance.compile.pass.cpp --- a/libcxx/test/std/containers/sequences/vector.bool/iterator_concept_conformance.compile.pass.cpp +++ b/libcxx/test/std/containers/sequences/vector.bool/iterator_concept_conformance.compile.pass.cpp @@ -11,9 +11,10 @@ // iterator, const_iterator, reverse_iterator, const_reverse_iterator +#include #include -#include +#include "test_macros.h" using iterator = std::vector::iterator; using const_iterator = std::vector::const_iterator; @@ -25,7 +26,11 @@ static_assert( std::random_access_iterator); static_assert(!std::contiguous_iterator); static_assert(!std::contiguous_iterator); +#if TEST_STD_VER > 20 +static_assert( std::indirectly_writable); +#else static_assert(!std::indirectly_writable); +#endif static_assert( std::sentinel_for); static_assert( std::sentinel_for); static_assert(!std::sentinel_for); diff --git a/libcxx/test/std/containers/sequences/vector.bool/reference/assign_bool.pass.cpp b/libcxx/test/std/containers/sequences/vector.bool/reference/assign_bool.pass.cpp --- a/libcxx/test/std/containers/sequences/vector.bool/reference/assign_bool.pass.cpp +++ b/libcxx/test/std/containers/sequences/vector.bool/reference/assign_bool.pass.cpp @@ -13,6 +13,8 @@ #include #include +#include "test_macros.h" + bool test() { std::vector vec; typedef std::vector::reference Ref; @@ -31,6 +33,15 @@ assert(cref); +#if TEST_STD_VER > 20 + cref = false; + assert(!vec[0]); + assert(!vec[1]); + cref = true; + assert(vec[0]); + assert(!vec[1]); +#endif + return true; }