public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@adacore.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@adacore.com>
Subject: [PATCH] Fix build with clang 16
Date: Mon, 11 Dec 2023 10:05:39 -0700	[thread overview]
Message-ID: <20231211170539.1154291-1-tromey@adacore.com> (raw)

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


             reply	other threads:[~2023-12-11 17:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-11 17:05 Tom Tromey [this message]
2023-12-22 16:35 ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231211170539.1154291-1-tromey@adacore.com \
    --to=tromey@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).