* [PATCH] Fix build with clang 16
@ 2023-12-11 17:05 Tom Tromey
2023-12-22 16:35 ` Tom Tromey
0 siblings, 1 reply; 2+ messages in thread
From: Tom Tromey @ 2023-12-11 17:05 UTC (permalink / raw)
To: gdb-patches; +Cc: Tom Tromey
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
---
gdbsupport/new-op.cc | 5 +++++
1 file changed, 5 insertions(+)
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 <new>
+/* These are declared in <new> 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
--
2.43.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Fix build with clang 16
2023-12-11 17:05 [PATCH] Fix build with clang 16 Tom Tromey
@ 2023-12-22 16:35 ` Tom Tromey
0 siblings, 0 replies; 2+ messages in thread
From: Tom Tromey @ 2023-12-22 16:35 UTC (permalink / raw)
To: Tom Tromey; +Cc: gdb-patches
>>>>> "Tom" == Tom Tromey <tromey@adacore.com> writes:
Tom> clang 16 reports a missing declaration in new-op.cc. We believed
Tom> these operators to be declared starting with C++14, but apparently
Tom> that is not the case.
Tom> This patch reverts the earlier change and then updates the comment to
Tom> reflect the current state.
Tom> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31141
I'm pushing this now.
Tom
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-12-22 16:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-11 17:05 [PATCH] Fix build with clang 16 Tom Tromey
2023-12-22 16:35 ` Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).