https://gcc.gnu.org/g:152d4e3cf14fcf7f6e3fadbd7e0eb2b74c2233a3

commit r16-2357-g152d4e3cf14fcf7f6e3fadbd7e0eb2b74c2233a3
Author: Jonathan Wakely <jwak...@redhat.com>
Date:   Sat Jul 19 00:08:26 2025 +0100

    libstdc++: Only define __any_input_iterator for C++20
    
    Currently this new concept will get defined for -std=c++17 -fconcepts
    but as it uses std::input_iterator, which is new in C++20, that won't
    work. Guard it with __cpp_lib_concepts as well as __cpp_concepts.
    
    libstdc++-v3/ChangeLog:
    
            * include/bits/stl_iterator_base_types.h (__any_input_iterator):
            Only define when __cpp_lib_concepts is defined.

Diff:
---
 libstdc++-v3/include/bits/stl_iterator_base_types.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libstdc++-v3/include/bits/stl_iterator_base_types.h 
b/libstdc++-v3/include/bits/stl_iterator_base_types.h
index 71da909613ea..0c34ad792f7a 100644
--- a/libstdc++-v3/include/bits/stl_iterator_base_types.h
+++ b/libstdc++-v3/include/bits/stl_iterator_base_types.h
@@ -258,10 +258,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     concept __has_input_iter_cat
       = is_convertible_v<__iter_category_t<_InIter>, input_iterator_tag>;
 
+#ifdef __cpp_lib_concepts
   // Is a Cpp17InputIterator or satisfies std::input_iterator.
   template<typename _InIterator>
     concept __any_input_iterator
       = input_iterator<_InIterator> || __has_input_iter_cat<_InIterator>;
+#endif
 #endif
 
   template<typename _It,

Reply via email to