diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2019-03-01 13:50:41 +0000 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2019-03-01 13:50:41 +0000 |
commit | c5effe9673bd266887b5c4cb968cce61ce137ca1 (patch) | |
tree | 7111bea6acf455f2995fbc6bdfda9981f2840dd7 | |
parent | 987bbe48bb03e04810e6c97f292549f11b5b2126 (diff) | |
download | gcc-c5effe9673bd266887b5c4cb968cce61ce137ca1.zip gcc-c5effe9673bd266887b5c4cb968cce61ce137ca1.tar.gz gcc-c5effe9673bd266887b5c4cb968cce61ce137ca1.tar.bz2 |
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
-rw-r--r-- | libstdc++-v3/ChangeLog | 3 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/util/testsuite_allocator.h | 4 |
2 files changed, 7 insertions, 0 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 67249de..9c4ef40 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -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): diff --git a/libstdc++-v3/testsuite/util/testsuite_allocator.h b/libstdc++-v3/testsuite/util/testsuite_allocator.h index 044b9d5..6277492 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; |