libstdc++-v3/ChangeLog:

        PR libstdc++/109849
        * include/bits/vector.tcc (vector::_M_range_insert): Fix
        reversed args in length calculation.
---

Tested x86_64-linux, pushed to trunk. Backport to gcc-14 to follow after
testing.

 libstdc++-v3/include/bits/vector.tcc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libstdc++-v3/include/bits/vector.tcc 
b/libstdc++-v3/include/bits/vector.tcc
index 44920a0549ab..4f4c366080be 100644
--- a/libstdc++-v3/include/bits/vector.tcc
+++ b/libstdc++-v3/include/bits/vector.tcc
@@ -934,7 +934,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
                const size_type __len =
                  _M_check_len(__n, "vector::_M_range_insert");
 #if __cplusplus < 201103L
-               if (__len < (__n + (__old_start - __old_finish)))
+               if (__len < (__n + (__old_finish - __old_start)))
                  __builtin_unreachable();
 #endif
 
-- 
2.47.1

Reply via email to