On Fri, Feb 6, 2026 at 11:54 AM Jonathan Wakely <[email protected]> wrote:
> > > On Fri, 6 Feb 2026, 10:34 Tomasz Kaminski, <[email protected]> wrote: > >> >> >> On Fri, Feb 6, 2026 at 10:14 AM Nathan Myers <[email protected]> wrote: >> >>> 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 >>> --- >>> >> LGTM, defining the concept only if we provide extensions that need them >> is reasonable. We can always change that if more places will depend on >> that >> and conditions will become unwieldy. >> >> I think you can commit that as an obvious fix, without need for Jonathan >> approval. >> > > Yes, I think it was already pushed. > I spoke to early, and assume the change was actually tested, but the tests fails because we need to update guards concepts: diff --git a/libstdc++-v3/include/bits/hashtable.h b/libstdc++-v3/include/bits/hashtable.h index f7b8905d8ab..48695c013f3 100644 --- a/libstdc++-v3/include/bits/hashtable.h +++ b/libstdc++-v3/include/bits/hashtable.h @@ -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> && diff --git a/libstdc++-v3/include/bits/stl_tree.h b/libstdc++-v3/include/bits/stl_tree.h index 7a733241ec5..5d361b55028 100644 --- a/libstdc++-v3/include/bits/stl_tree.h +++ b/libstdc++-v3/include/bits/stl_tree.h @@ -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> & Testing the change, and will push it once all tests passed. > > > >> 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 657f40bca2e..1312564216b 100644 >>> --- a/libstdc++-v3/include/bits/stl_function.h >>> +++ b/libstdc++-v3/include/bits/stl_function.h >>> >> The file does not include bits/version.h, so we assume that it is >> included before, >> and we already use __glibcxx_transparent_operators in the file, so this >> is not a problem >> of this change. I have looked, and we bring bits version via type_traits >> inclusion. >> >> >>> @@ -1525,7 +1525,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION >>> #endif >>> #endif >>> >>> -#ifdef __cpp_concepts >>> +#ifdef __glibcxx_associative_heterogeneous_erasure // C++23 >>> 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 >>> >>> -- >>> 2.52.0 >>> >>>
