Fix test memory_resource to work without sized deallocation
authorJonathan Wakely <jwakely@redhat.com>
Fri, 1 Mar 2019 13:50:41 +0000 (13:50 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Fri, 1 Mar 2019 13:50:41 +0000 (13:50 +0000)
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
libstdc++-v3/testsuite/util/testsuite_allocator.h

index 67249de5bf5a1cd6b3d44e1ed78c08756dc0e2c7..9c4ef4037ca7ded07a610d9c4ef3f6ab5640a0ab 100644 (file)
@@ -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):
index 044b9d5a90f29aea4a9ab684e149448fd3dc5ba0..627749299d23751d9fd90a6a28c5e425807c61fd 100644 (file)
@@ -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;