https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113239
--- Comment #15 from Jonathan Wakely <redi at gcc dot gnu.org> --- This makes the compiler shut up: --- a/libstdc++-v3/include/bits/stl_vector.h +++ b/libstdc++-v3/include/bits/stl_vector.h @@ -605,6 +605,9 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER : _Base(__x.size(), _Alloc_traits::_S_select_on_copy(__x._M_get_Tp_allocator())) { + if (__x.size() > capacity()) + __builtin_unreachable(); + this->_M_impl._M_finish = std::__uninitialized_copy_a(__x.begin(), __x.end(), this->_M_impl._M_start,