From 737c32062799bccb0633e1b51ae1f705043e7ab8 Mon Sep 17 00:00:00 2001 From: "Gabriel A. Devenyi" Date: Thu, 25 Jun 2026 10:24:36 -0400 Subject: [PATCH] KWSys: use allocator_traits::rebind_alloc for C++20 std::allocator::rebind was deprecated in C++17 and removed in C++20, so libstdc++ in newer toolchains (e.g. GCC 14/15 on Fedora 44) no longer provides _Alloc::rebind, breaking the hash_map/hash_set hashtable template: error: no type named 'other' in 'std::allocator<...>::rebind<...>' Replace the three `typename _Alloc::template rebind::other` typedefs with the C++11 `std::allocator_traits<_Alloc>::template rebind_alloc`, which is the standard replacement and works on all supported standards. is already included. --- Modules/ThirdParty/KWSys/src/KWSys/hashtable.hxx.in | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Modules/ThirdParty/KWSys/src/KWSys/hashtable.hxx.in b/Modules/ThirdParty/KWSys/src/KWSys/hashtable.hxx.in index dd92cb9d422..9b59bc13cf3 100644 --- a/Modules/ThirdParty/KWSys/src/KWSys/hashtable.hxx.in +++ b/Modules/ThirdParty/KWSys/src/KWSys/hashtable.hxx.in @@ -249,13 +249,15 @@ private: typedef _Hashtable_node<_Val> _Node; public: - typedef typename _Alloc::template rebind<_Val>::other allocator_type; + typedef typename std::allocator_traits<_Alloc>::template rebind_alloc<_Val> + allocator_type; allocator_type get_allocator() const { return _M_node_allocator; } private: + typedef typename std::allocator_traits<_Alloc>::template rebind_alloc<_Node> + _M_node_allocator_type; typedef - typename _Alloc::template rebind<_Node>::other _M_node_allocator_type; - typedef - typename _Alloc::template rebind<_Node*>::other _M_node_ptr_allocator_type; + typename std::allocator_traits<_Alloc>::template rebind_alloc<_Node*> + _M_node_ptr_allocator_type; typedef std::vector<_Node*, _M_node_ptr_allocator_type> _M_buckets_type; private: