https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64841
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I wonder if the correct fix would be:
--- a/libsanitizer/asan/asan_new_delete.cc
+++ b/libsanitizer/asan/asan_new_delete.cc
@@ -103,6 +103,7 @@ CXX_OPERATOR_ATTRIBUTE
void operator delete[](void *ptr, std::nothrow_t const&) {
OPERATOR_DELETE_BODY(FROM_NEW_BR);
}
+#if __cpp_sized_deallocation
CXX_OPERATOR_ATTRIBUTE
void operator delete(void *ptr, size_t size) throw() {
GET_STACK_TRACE_FREE;
@@ -113,6 +114,7 @@ void operator delete[](void *ptr, size_t size) throw() {
GET_STACK_TRACE_FREE;
asan_sized_free(ptr, size, &stack, FROM_NEW_BR);
}
+#endif
#else // SANITIZER_MAC
INTERCEPTOR(void, _ZdlPv, void *ptr) {
That way the functions are only declared if the compiler knows what to do with
them (i.e. it supports the C++14 sized deallocation feature).
The patch should go to the libsanitizer upstream though.