https://gcc.gnu.org/g:1aababb8e205a441fe55f9acecc8c6c1ca552ec6

commit r17-618-g1aababb8e205a441fe55f9acecc8c6c1ca552ec6
Author: Nathan Myers <[email protected]>
Date:   Tue May 19 19:51:21 2026 -0400

    libstdc++: fix build failures after acfdad706d8
    
    Patch build failures from 2026-05-19 09:33:58
    
    libstdc++-v3/Changelog:
            * config/abi/pre/gnu.ver: Remove recent symbol swept up in
            GLIBCXX_3.4.21.
            * include/bits/basic_string.tcc (reserve): Guard __limit decl
            under #if __cpp_exceptions to quiet warning.

Diff:
---
 libstdc++-v3/config/abi/pre/gnu.ver        |  2 +-
 libstdc++-v3/include/bits/basic_string.tcc | 14 ++++++++------
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/libstdc++-v3/config/abi/pre/gnu.ver 
b/libstdc++-v3/config/abi/pre/gnu.ver
index bf4d7338cb6c..3a6afac83087 100644
--- a/libstdc++-v3/config/abi/pre/gnu.ver
+++ b/libstdc++-v3/config/abi/pre/gnu.ver
@@ -1775,7 +1775,7 @@ GLIBCXX_3.4.21 {
     
_ZNSt7__cxx1112basic_stringI[cw]St11char_traitsI[cw]ESaI[cw]EE12_M_constructI[NP]*;
     _ZNSt7__cxx1112basic_stringI[cw]St11char_traitsI[cw]ESaI[cw]EE13*;
     
_ZNSt7__cxx1112basic_stringI[cw]St11char_traitsI[cw]ESaI[cw]EE14_M_replace_aux*;
-    _ZNSt7__cxx1112basic_stringI[cw]St11char_traitsI[cw]ESaI[cw]EE1[68-9]*;
+    _ZNSt7__cxx1112basic_stringI[cw]St11char_traitsI[cw]ESaI[cw]EE1[68]*;
     _ZNSt7__cxx1112basic_stringI[cw]St11char_traitsI[cw]ESaI[cw]EE2at*;
     _ZNSt7__cxx1112basic_stringI[cw]St11char_traitsI[cw]ESaI[cw]EE3end*;
     _ZNSt7__cxx1112basic_stringI[cw]St11char_traitsI[cw]ESaI[cw]EE4back*;
diff --git a/libstdc++-v3/include/bits/basic_string.tcc 
b/libstdc++-v3/include/bits/basic_string.tcc
index 5f83991db83f..64c99fbb9d64 100644
--- a/libstdc++-v3/include/bits/basic_string.tcc
+++ b/libstdc++-v3/include/bits/basic_string.tcc
@@ -433,11 +433,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       if (_M_is_local())
        return;
 
-#ifdef __glibcxx_allocate_at_least  // C++23
-      const size_type __limit = (__STDCPP_DEFAULT_NEW_ALIGNMENT__ - 1) / 
sizeof(_CharT);
-#else
-      const size_type __limit = 0;
-#endif
       const size_type __length = length();
       const size_type __capacity = _M_allocated_capacity;
 
@@ -447,9 +442,16 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
          this->_S_copy(_M_local_buf, _M_data(), __length + 1);
          _M_destroy(__capacity);
          _M_data(_M_local_data());
+         return;
        }
 #if __cpp_exceptions
-      else if (__capacity - __length > __limit )
+#ifdef __glibcxx_allocate_at_least  // C++23
+      const size_type __limit =
+       (__STDCPP_DEFAULT_NEW_ALIGNMENT__ - 1) / sizeof(_CharT);
+#else
+      const size_type __limit = 0;
+#endif
+      if (__capacity - __length > __limit )
        try
          {
            _Alloc_result __r = _S_allocate_at_least(

Reply via email to