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

Peng Liu via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jan 29 13:08:52 PST 2025


================
@@ -23,6 +26,11 @@ class __bit_iterator;
 template <class, class = void>
 struct __size_difference_type_traits;
 
+template <class _StoragePointer,
+          __enable_if_t<is_unsigned<typename pointer_traits<_StoragePointer>::element_type>::value, int> = 0>
----------------
winner245 wrote:

This makes perfect sense to me. I've implemented the suggested changes and made some minor refinements to the code comments.

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


More information about the libcxx-commits mailing list