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
This commit is contained in:
parent
987bbe48bb
commit
c5effe9673
2 changed files with 7 additions and 0 deletions
|
@ -1,5 +1,8 @@
|
|||
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;
|
||||
|
|
Loading…
Add table
Reference in a new issue