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
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).
PR libstdc++/90281 Fix string conversions for filesystem::path
#include <cstdlib>
#include <testsuite_hooks.h>
+#if __cplusplus >= 201103L
+# define NOTHROW noexcept
+#else
+# define NOTHROW throw()
+#endif
+
struct gnu { };
bool check_new = false;
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<gnu> obj;