[Bug libstdc++/114367] std::vector<bool> constexpr initialization doesn't start lifetime of array members

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Mar 16 22:13:01 GMT 2024


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114367

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Hmm:

        _Bit_pointer __p = _Bit_alloc_traits::allocate(_M_impl, _S_nword(__n));
#if __cpp_lib_is_constant_evaluated
        if (std::is_constant_evaluated())
        {
          __n = _S_nword(__n);
          for (size_t __i = 0; __i < __n; ++__i)
            __p[__i] = 0ul;
        }
#endif

Maybe I misunderstand how this should work.


More information about the Gcc-bugs mailing list