]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Update guards on __heterogeneous_hash_key and __heterogeneous_tree_key
authorTomasz Kamiński <tkaminsk@redhat.com>
Fri, 6 Feb 2026 11:03:37 +0000 (12:03 +0100)
committerTomasz Kamiński <tkaminsk@redhat.com>
Fri, 6 Feb 2026 13:06:46 +0000 (14:06 +0100)
The r16-7359-gae04c1afd1526a changed __heterogeneous_key to be
defined if __glibcxx_associative_heterogeneous_erasure, but missed
guards on derived __heterogeneous_hash_key and __heterogeneous_tree_key
concept.

libstdc++-v3/ChangeLog:

* include/bits/hashtable.h (std::__heterogeneous_hash_key)
[__glibcxx_associative_heterogeneous_erasure]: Changed guard.
* include/bits/stl_tree.h (std::__heterogeneous_tree_key)
[__glibcxx_associative_heterogeneous_erasure]: Likewise.
* include/bits/stl_function.h: Add comment with C++ version
for __glibcxx_associative_heterogeneous_erasure guard.

libstdc++-v3/include/bits/hashtable.h
libstdc++-v3/include/bits/stl_function.h
libstdc++-v3/include/bits/stl_tree.h

index f7b8905d8ab9e92518818d6334177f18b67c1d12..48695c013f38bf21772d51c4f14a72470cf8017a 100644 (file)
@@ -3012,7 +3012,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       = __enable_if_t<!__or_<is_integral<_Hash>, __is_allocator<_Hash>>::value>;
 #endif
 
-#ifdef __cpp_concepts
+#ifdef __glibcxx_associative_heterogeneous_erasure // C++ >= 23
 template <typename _Kt, typename _Container>
   concept __heterogeneous_hash_key =
     __transparent_comparator<typename _Container::hasher> &&
index 1312564216bdc240846a1f9ffefbe3c667c32e8c..95c24d44b9efb59702c924c5f032a75241e7844c 100644 (file)
@@ -1525,7 +1525,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 #endif
 #endif
 
-#ifdef __glibcxx_associative_heterogeneous_erasure
+#ifdef __glibcxx_associative_heterogeneous_erasure // C++ >= 23
 template <typename _Kt, typename _Container>
   concept __not_container_iterator =
     (!is_convertible_v<_Kt&&, typename _Container::iterator> &&
index 7a733241ec5bae90891b18b558492b71e43cc9f6..5d361b55028fb0e7d0ebad5dfaa72e338671d666 100644 (file)
@@ -3315,7 +3315,7 @@ namespace __rb_tree
     };
 #endif // C++17
 
-#ifdef __cpp_concepts
+#ifdef __glibcxx_associative_heterogeneous_erasure // C++ >= 23
 template <typename _Kt, typename _Container>
   concept __heterogeneous_tree_key =
     __transparent_comparator<typename _Container::key_compare> &&