https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110620
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |pinskia at gcc dot gnu.org --- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> --- So I think inside _M_range_initialize_n, we can change it to be: template<typename _Iterator, typename _Sentinel> _GLIBCXX20_CONSTEXPR void _M_range_initialize_n(_Iterator __first, _Sentinel __last, size_type __n) { pointer __start = this->_M_impl._M_start = this->_M_allocate(_S_check_init_len(__n, _M_get_Tp_allocator())); this->_M_impl._M_end_of_storage = __start + __n; this->_M_impl._M_finish = std::__uninitialized_copy_a(_GLIBCXX_MOVE(__first), __last, __start, _M_get_Tp_allocator()); if (this->_M_impl._M_finish - this->_M_impl._M_start != __n) __builtin_unreachable(); } We might want to do the same thing for _M_fill_initialize and _M_default_initialize too. So mine.