https://gcc.gnu.org/g:74bdc47e68493d161953b8c4238a8e9d82981286

commit r16-7969-g74bdc47e68493d161953b8c4238a8e9d82981286
Author: François Dumont <[email protected]>
Date:   Mon Mar 9 21:58:45 2026 +0100

    libstdc++: [_GLIBCXX_DEBUG] Constrain basic_string iterator constructor
    
    Constrain __gnu_debug::basic_string(_Ite, _Ite, const _Alloc&) _Ite template
    parameter so that it is an iterator type.
    
    libstdc++-v3/ChangeLog:
    
            * include/debug/string
            [__cplusplus >= 201103L](basic_string(_Ite, _Ite, const _Alloc&)): 
Add
            std::_RequireInputIter<_Ite> template parameter.
    
    Reviewed-by: Jonathan Wakely <[email protected]>

Diff:
---
 libstdc++-v3/include/debug/string | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libstdc++-v3/include/debug/string 
b/libstdc++-v3/include/debug/string
index d5ee1d9e1938..556e1d639390 100644
--- a/libstdc++-v3/include/debug/string
+++ b/libstdc++-v3/include/debug/string
@@ -231,7 +231,12 @@ namespace __gnu_debug
                   const _Allocator& __a = _Allocator())
       : _Base(__n, __c, __a) { }
 
+#if __cplusplus >= 201103L
+      template<typename _InputIterator,
+              typename = std::_RequireInputIter<_InputIterator>>
+#else
       template<typename _InputIterator>
+#endif
        basic_string(_InputIterator __begin, _InputIterator __end,
                     const _Allocator& __a = _Allocator())
        : _Base(__gnu_debug::__base(

Reply via email to