From: Tom Tromey Date: Mon, 11 Dec 2023 17:04:23 +0000 (-0700) Subject: Fix build with clang 16 X-Git-Tag: binutils-2_42~420 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9b9e5c09b1879766af959d276e99780982f4350b;p=thirdparty%2Fbinutils-gdb.git Fix build with clang 16 clang 16 reports a missing declaration in new-op.cc. We believed these operators to be declared starting with C++14, but apparently that is not the case. This patch reverts the earlier change and then updates the comment to reflect the current state. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31141 --- diff --git a/gdbsupport/new-op.cc b/gdbsupport/new-op.cc index 181fc4957fa..12bd5d263a6 100644 --- a/gdbsupport/new-op.cc +++ b/gdbsupport/new-op.cc @@ -27,6 +27,11 @@ #include "host-defs.h" #include +/* These are declared in starting C++14, but removing them + caused a build failure with clang. See PR build/31141. */ +extern void operator delete (void *p, std::size_t) noexcept; +extern void operator delete[] (void *p, std::size_t) noexcept; + /* Override operator new / operator new[], in order to internal_error on allocation failure and thus query the user for abort/core dump/continue, just like xmalloc does. We don't do this from a