https://gcc.gnu.org/g:ae04c1afd1526a6d468777809c50a9d02816ded9

commit r16-7359-gae04c1afd1526a6d468777809c50a9d02816ded9
Author: Nathan Myers <[email protected]>
Date:   Fri Feb 6 03:56:42 2026 -0500

    libstdc++: fix C++17 regression in concept __heterogeneous_key (2nd)
    
    The commit 3f7905550483408a2c4c5096a1adc8d7e863eb12 defined a
    concept __heterogeneous_key using a name not defined in C++17.
    This is fixed by guarding the definition behind a name defined
    in C++23 the earliest Standard that uses the definition.
    
    https://gcc.gnu.org/pipermail/gcc-patches/2026-February/707814.html
    
    libstdc++-v3/ChangeLog
            * include/bits/stl_function.h (concept __heterogeneous_key):
            Guard with __glibcxx_associative_heterogeneous_erasure

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

diff --git a/libstdc++-v3/include/bits/stl_function.h 
b/libstdc++-v3/include/bits/stl_function.h
index 657f40bca2ee..1312564216bd 100644
--- a/libstdc++-v3/include/bits/stl_function.h
+++ b/libstdc++-v3/include/bits/stl_function.h
@@ -1525,7 +1525,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 #endif
 #endif
 
-#ifdef __cpp_concepts
+#ifdef __glibcxx_associative_heterogeneous_erasure
 template <typename _Kt, typename _Container>
   concept __not_container_iterator =
     (!is_convertible_v<_Kt&&, typename _Container::iterator> &&
@@ -1533,8 +1533,7 @@ template <typename _Kt, typename _Container>
 
 template <typename _Kt, typename _Container>
   concept __heterogeneous_key =
-    (!is_same_v<typename _Container::key_type,
-               typename remove_cvref<_Kt>::type>) &&
+    (!is_same_v<typename _Container::key_type, remove_cvref_t<_Kt>>) &&
     __not_container_iterator<_Kt, _Container>;
 #endif

Reply via email to