From c5effe9673bd266887b5c4cb968cce61ce137ca1 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Fri, 1 Mar 2019 13:50:41 +0000 Subject: [PATCH] Fix test memory_resource to work without sized deallocation The checking memory_resource in the testsuite assumes sized deallocation is supported, which might not be true for other compilers. * testsuite/util/testsuite_allocator.h (__gnu_test::memory_resource) [!__cpp_sized_deallocation]: Do not pass size to operator delete. From-SVN: r269312 --- libstdc++-v3/ChangeLog | 3 +++ libstdc++-v3/testsuite/util/testsuite_allocator.h | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 67249de5bf5..9c4ef4037ca 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,8 @@ 2019-03-01 Jonathan Wakely + * testsuite/util/testsuite_allocator.h (__gnu_test::memory_resource) + [!__cpp_sized_deallocation]: Do not pass size to operator delete. + * include/std/memory (uses_allocator_construction_args): New set of overloaded functions. (make_obj_using_allocator, uninitialized_construct_using_allocator): diff --git a/libstdc++-v3/testsuite/util/testsuite_allocator.h b/libstdc++-v3/testsuite/util/testsuite_allocator.h index 044b9d5a90f..627749299d2 100644 --- a/libstdc++-v3/testsuite/util/testsuite_allocator.h +++ b/libstdc++-v3/testsuite/util/testsuite_allocator.h @@ -780,7 +780,11 @@ namespace __gnu_test throw bad_size(); if (alignment != a->alignment) throw bad_alignment(); +#if __cpp_sized_deallocation ::operator delete(p, bytes, std::align_val_t(alignment)); +#else + ::operator delete(p, std::align_val_t(alignment)); +#endif *aptr = a->next; a->next = lists->freed; lists->freed = a; -- 2.30.2