https://gcc.gnu.org/g:6f85a97248fdff15aadc9514c1118eee0293d256

commit r15-6926-g6f85a97248fdff15aadc9514c1118eee0293d256
Author: Jonathan Wakely <jwak...@redhat.com>
Date:   Wed Jan 15 09:33:55 2025 +0000

    libstdc++: Fix reversed args in unreachable assumption [PR109849]
    
    libstdc++-v3/ChangeLog:
    
            PR libstdc++/109849
            * include/bits/vector.tcc (vector::_M_range_insert): Fix
            reversed args in length calculation.

Diff:
---
 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

Reply via email to