From: Jonathan Wakely Date: Mon, 17 Jun 2019 15:51:31 +0000 (+0100) Subject: Fix AIX test failure due to replacement operator delete X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=39f901e918c42935d1acf5ad87b79ae1b38a666b;p=gcc.git Fix AIX test failure due to replacement operator delete On AIX the sized delete defined in the library will call the non-sized delete defined in the library, not the replacement version defined in the test file. By also replacing sized delete we make the test pass everywhere. * testsuite/20_util/allocator/1.cc: Add sized delete, which fixes a failure on AIX. From-SVN: r272391 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 8311111bd12..40d1b0beb2c 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,8 @@ 2019-06-17 Jonathan Wakely + * testsuite/20_util/allocator/1.cc: Add sized delete, which fixes a + failure on AIX. + * include/c_global/cmath (__lerp, lerp): Add noexcept (LWG 3201). PR libstdc++/90281 Fix string conversions for filesystem::path diff --git a/libstdc++-v3/testsuite/20_util/allocator/1.cc b/libstdc++-v3/testsuite/20_util/allocator/1.cc index 8ea08958f8d..c8a74dacf63 100644 --- a/libstdc++-v3/testsuite/20_util/allocator/1.cc +++ b/libstdc++-v3/testsuite/20_util/allocator/1.cc @@ -24,6 +24,12 @@ #include #include +#if __cplusplus >= 201103L +# define NOTHROW noexcept +#else +# define NOTHROW throw() +#endif + struct gnu { }; bool check_new = false; @@ -36,12 +42,19 @@ operator new(std::size_t n) THROW(std::bad_alloc) return std::malloc(n); } -void operator delete(void *v) throw() +void operator delete(void *v) NOTHROW { check_delete = true; return std::free(v); } +#if __cpp_sized_deallocation +void operator delete(void *v, std::size_t) NOTHROW +{ + ::operator delete(v); +} +#endif + void test01() { std::allocator obj;