]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Ensure <bits/ranges_util.h> defines __pair_like
authorJonathan Wakely <jwakely@redhat.com>
Thu, 6 Mar 2025 11:20:23 +0000 (11:20 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Thu, 6 Mar 2025 16:14:59 +0000 (16:14 +0000)
We need to include <bits/stl_pair.h> in C++23 and later, so that
__pair_like_convertible_from can use __pair_like, and so that
__is_tuple_like_v is declared before we define a partial specialization.

libstdc++-v3/ChangeLog:

* include/bits/ranges_util.h: Include <bits/stl_pair.h>.

Reviewed-by: Patrick Palka <ppalka@redhat.com>
libstdc++-v3/include/bits/ranges_util.h

index 51024ecbebe5e88dd7869ffa5db394368d4e6f2a..54e4f6261b0553e71a9ff7145c4869bf5f09a04d 100644 (file)
@@ -35,6 +35,9 @@
 # include <bits/utility.h>
 # include <bits/invoke.h>
 # include <bits/cpp_type_traits.h> // __can_use_memchr_for_find
+#if __glibcxx_tuple_like // >= C++23
+# include <bits/stl_pair.h> // __pair_like, __is_tuple_like_v
+#endif
 
 #ifdef __glibcxx_ranges
 namespace std _GLIBCXX_VISIBILITY(default)