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
This commit is contained in:
parent
35d57c9572
commit
39f901e918
|
@ -1,5 +1,8 @@
|
||||||
2019-06-17 Jonathan Wakely <jwakely@redhat.com>
|
2019-06-17 Jonathan Wakely <jwakely@redhat.com>
|
||||||
|
|
||||||
|
* 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).
|
* include/c_global/cmath (__lerp, lerp): Add noexcept (LWG 3201).
|
||||||
|
|
||||||
PR libstdc++/90281 Fix string conversions for filesystem::path
|
PR libstdc++/90281 Fix string conversions for filesystem::path
|
||||||
|
|
|
@ -24,6 +24,12 @@
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <testsuite_hooks.h>
|
#include <testsuite_hooks.h>
|
||||||
|
|
||||||
|
#if __cplusplus >= 201103L
|
||||||
|
# define NOTHROW noexcept
|
||||||
|
#else
|
||||||
|
# define NOTHROW throw()
|
||||||
|
#endif
|
||||||
|
|
||||||
struct gnu { };
|
struct gnu { };
|
||||||
|
|
||||||
bool check_new = false;
|
bool check_new = false;
|
||||||
|
@ -36,12 +42,19 @@ operator new(std::size_t n) THROW(std::bad_alloc)
|
||||||
return std::malloc(n);
|
return std::malloc(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
void operator delete(void *v) throw()
|
void operator delete(void *v) NOTHROW
|
||||||
{
|
{
|
||||||
check_delete = true;
|
check_delete = true;
|
||||||
return std::free(v);
|
return std::free(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if __cpp_sized_deallocation
|
||||||
|
void operator delete(void *v, std::size_t) NOTHROW
|
||||||
|
{
|
||||||
|
::operator delete(v);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void test01()
|
void test01()
|
||||||
{
|
{
|
||||||
std::allocator<gnu> obj;
|
std::allocator<gnu> obj;
|
||||||
|
|
Loading…
Reference in New Issue