[libcxx-commits] [libcxx] [libc++] Fix possible out of range access in bitset (PR #121348)
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Mar 26 09:31:10 PDT 2025
================
@@ -218,10 +220,10 @@ protected:
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 void flip() _NOEXCEPT;
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unsigned long to_ulong() const {
- return to_ulong(integral_constant < bool, _Size< sizeof(unsigned long) * CHAR_BIT>());
+ return __to_ulong(_BoolConstant < _Size< sizeof(unsigned long) * CHAR_BIT>());
----------------
ldionne wrote:
The current formatting is pretty confusing. I think `clang-format` will let you change the spacing around these brackets without complaining. I'd change to `__to_ulong(_BoolConstant<(_Size < sizeof(unsigned long) * CHAR_BIT)>())`.
https://github.com/llvm/llvm-project/pull/121348
More information about the libcxx-commits
mailing list