From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1984) id 408143BB580E; Fri, 17 Jul 2020 14:42:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 408143BB580E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1594996940; bh=CBdQjlzUaoNbvV73LaPCbLTziSTGlvkSz970CKsRS9o=; h=From:To:Subject:Date:From; b=xy1ei/AWhHQCcA1YPEgbBn8wGye6aBzHr0K/iJIuZQB2GNPBfIT5O7oMFlfFWSc5V ZhFSxd19kROx6yg0dXo7h2Ei/gbxcyMY3dUpPLlOxH0PHHiyiPbm3yS/I4L1gYBxP2 d+KKUEaU1d1E42FsSaqHgyS/f3BS9aJZGEOMBaJ4= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Tamar Christina To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc(refs/vendors/ARM/heads/arm-perf-staging)] libstdc++: Fix testsuite utility's use of allocators X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/vendors/ARM/heads/arm-perf-staging X-Git-Oldrev: bd2420f8faaf4bb33310e82f7dd45c5e33476c87 X-Git-Newrev: c9960294062dbda0847d26a1b5ee37a55210d69c Message-Id: <20200717144220.408143BB580E@sourceware.org> Date: Fri, 17 Jul 2020 14:42:20 +0000 (GMT) X-BeenThere: libstdc++-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jul 2020 14:42:20 -0000 https://gcc.gnu.org/g:c9960294062dbda0847d26a1b5ee37a55210d69c commit c9960294062dbda0847d26a1b5ee37a55210d69c Author: Jonathan Wakely Date: Sat Apr 18 00:10:54 2020 +0100 libstdc++: Fix testsuite utility's use of allocators In C++20 the rebind and const_reference members of std::allocator are gone, so this testsuite utility stopped working, causing ext/pb_ds/regression/priority_queue_rand_debug.cc to FAIL. * testsuite/util/native_type/native_priority_queue.hpp: Use allocator_traits to rebind allocator. Diff: --- libstdc++-v3/ChangeLog | 5 ++++ .../util/native_type/native_priority_queue.hpp | 27 +++++++++++++++++----- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index de9323bebe0..64c862c1d03 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,8 @@ +2020-04-18 Jonathan Wakely + + * testsuite/util/native_type/native_priority_queue.hpp: Use + allocator_traits to rebind allocator. + 2020-04-17 Jonathan Wakely * include/bits/forward_list.h (forward_list): Define operator<=> and diff --git a/libstdc++-v3/testsuite/util/native_type/native_priority_queue.hpp b/libstdc++-v3/testsuite/util/native_type/native_priority_queue.hpp index 1445892ebe0..1ceb446c0ee 100644 --- a/libstdc++-v3/testsuite/util/native_type/native_priority_queue.hpp +++ b/libstdc++-v3/testsuite/util/native_type/native_priority_queue.hpp @@ -55,20 +55,30 @@ namespace __gnu_pbds struct base_seq { private: - typedef typename _Alloc::template rebind value_rebind; +#if __cplusplus >= 201103L + using value_alloc = typename std::allocator_traits<_Alloc>::template + rebind_alloc; +#else + typedef typename _Alloc::template rebind::other value_alloc; +#endif public: - typedef std::vector type; + typedef std::vector type; }; template struct base_seq { private: - typedef typename _Alloc::template rebind value_rebind; +#if __cplusplus >= 201103L + using value_alloc = typename std::allocator_traits<_Alloc>::template + rebind_alloc; +#else + typedef typename _Alloc::template rebind::other value_alloc; +#endif public: - typedef std::deque type; + typedef std::deque type; }; } // namespace detail @@ -89,11 +99,16 @@ namespace __gnu_pbds { private: typedef PB_DS_BASE_C_DEC base_type; - typedef typename _Alloc::template rebind value_rebind; +#if __cplusplus >= 201103L + using value_ref = const Value_Type&; +#else + typedef typename + _Alloc::template rebind::other::const_reference value_ref; +#endif public: typedef Value_Type value_type; - typedef typename value_rebind::other::const_reference const_reference; + typedef value_ref const_reference; typedef native_pq_tag container_category; typedef Cmp_Fn cmp_fn;