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 @@ -25,7 +25,7 @@ static_assert( std::random_access_iterator); static_assert(!std::contiguous_iterator); static_assert(!std::contiguous_iterator); -static_assert(!std::indirectly_writable); +static_assert( std::indirectly_writable); 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 @@ -30,6 +30,12 @@ assert(!vec[1]); assert(cref); + cref = false; + assert(!vec[0]); + assert(!vec[1]); + cref = true; + assert(vec[0]); + assert(!vec[1]); return true; }