From 5aa5a00e74ea8a1ea22d6a9760b4b420687fa4e5 Mon Sep 17 00:00:00 2001 From: Conrad Poelman Date: Mon, 11 May 2020 21:55:00 -0400 Subject: [PATCH] C++20 / gcc10 fix: remove hint, removed typedef C++17 deprecated, and C++20 fully removed, the std::allocator::const_pointer typedef (https://en.cppreference.com/w/cpp/memory/allocator). So gcc10 fails to compile this file. The selected fix was to completely remove the hint argument because (a) it was ignored anyway, and (b) std::allocator's allocate() function also chose to remove its hint argument in C++20 (https://en.cppreference.com/w/cpp/memory/allocator/allocate). --- src/base/arena-inl.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/base/arena-inl.h b/src/base/arena-inl.h index 9408e9b..99ab4d3 100755 --- a/src/base/arena-inl.h +++ b/src/base/arena-inl.h @@ -93,8 +93,7 @@ template class ArenaAllocator { ArenaAllocator(C* arena) : arena_(arena) { } // NOLINT ~ArenaAllocator() { } - pointer allocate(size_type n, - std::allocator::const_pointer /*hint*/ = 0) { + pointer allocate(size_type n) { assert(arena_ && "No arena to allocate from!"); return reinterpret_cast(arena_->AllocAligned(n * sizeof(T), kAlignment));