[libcxx-commits] [libcxx] [libc++] Fix UB in bitwise logic of {std, ranges}::{fill, fill_n} algorithms (PR #122410)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jan 20 08:34:57 PST 2025


================
@@ -48,6 +51,41 @@ constexpr void test_iterators() {
   }
 }
 
+// The `ranges::{fill, fill_n}` algorithms require `vector<bool, Alloc>::iterator` to satisfy the
+// `std::indirectly_writable` concept when used with `vector<bool, Alloc>`, which is only met since C++23.
----------------
ldionne wrote:

```suggestion
// Make sure we behave properly with std::vector<bool> iterators with custom size types, see
// https://github.com/llvm/llvm-project/pull/122410.
//
// The `ranges::{fill, fill_n}` algorithms require `vector<bool, Alloc>::iterator` to satisfy the
// `std::indirectly_writable` concept when used with `vector<bool, Alloc>`, which is only met since C++23.
```

https://github.com/llvm/llvm-project/pull/122410


More information about the libcxx-commits mailing list