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

--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
Ontop of the patch I am testing the following fixes the diagnostics:

diff --git a/libstdc++-v3/include/bits/vector.tcc
b/libstdc++-v3/include/bits/vector.tcc
index 33faabf2eae..aab87b94882 100644
--- a/libstdc++-v3/include/bits/vector.tcc
+++ b/libstdc++-v3/include/bits/vector.tcc
@@ -784,13 +784,15 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
              {
                const size_type __len =
                  _M_check_len(__n, "vector::_M_range_insert");
+               pointer __tem = this->_M_impl._M_start;
+               pointer __tem2 = this->_M_impl._M_finish;
                pointer __new_start(this->_M_allocate(__len));
                pointer __new_finish(__new_start);
                __try
                  {
                    __new_finish
                      = std::__uninitialized_move_if_noexcept_a
-                     (this->_M_impl._M_start, __position.base(),
+                     (__tem, __position.base(),
                       __new_start, _M_get_Tp_allocator());
                    __new_finish
                      = std::__uninitialized_copy_a(__first, __last,
@@ -798,7 +800,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
                                                    _M_get_Tp_allocator());
                    __new_finish
                      = std::__uninitialized_move_if_noexcept_a
-                     (__position.base(), this->_M_impl._M_finish,
+                     (__position.base(), __tem2,
                       __new_finish, _M_get_Tp_allocator());
                  }
                __catch(...)

Reply via email to