Commit c5effe96 by Jonathan Wakely Committed by Jonathan Wakely

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
parent 987bbe48
2019-03-01 Jonathan Wakely <jwakely@redhat.com>
* 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):
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment