diff options
author | Tom de Vries <tdevries@suse.de> | 2021-11-11 11:22:39 +0100 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2021-11-11 11:22:39 +0100 |
commit | fdf95218bc08c60ef4528eb67b03643fdd16f036 (patch) | |
tree | 1ada427129520699294197ed077ff0f7b077e64d /gdbsupport | |
parent | b038b53f1ff4bf00ecdead1db23eddc4fd654305 (diff) | |
download | gdb-fdf95218bc08c60ef4528eb67b03643fdd16f036.zip gdb-fdf95218bc08c60ef4528eb67b03643fdd16f036.tar.gz gdb-fdf95218bc08c60ef4528eb67b03643fdd16f036.tar.bz2 |
[gdb/build] Fix Wimplicit-exception-spec-mismatch in clang build
When building with clang 13 (and -std=gnu++17 to work around an issue in
string_view-selftests.c), we run into a few Wimplicit-exception-spec-mismatch
warnings:
...
src/gdbsupport/new-op.cc:102:1: error: function previously declared with an \
explicit exception specification redeclared with an implicit exception \
specification [-Werror,-Wimplicit-exception-spec-mismatch]
operator delete (void *p)
^
/usr/include/c++/11/new:130:6: note: previous declaration is here
void operator delete(void*) _GLIBCXX_USE_NOEXCEPT
^
...
These are due to recent commit 5fff6115fea "Fix
LD_PRELOAD=/usr/lib64/libasan.so.6 gdb".
Fix this by adding the missing noexcept.
Build on x86_64-linux, using gcc 7.5.0 and clang 13.0.0.
Diffstat (limited to 'gdbsupport')
-rw-r--r-- | gdbsupport/new-op.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gdbsupport/new-op.cc b/gdbsupport/new-op.cc index 716fa1a..2fe5f64 100644 --- a/gdbsupport/new-op.cc +++ b/gdbsupport/new-op.cc @@ -104,7 +104,7 @@ operator new[] (std::size_t sz, const std::nothrow_t&) noexcept errors from AddressSanitizers. */ void -operator delete (void *p) +operator delete (void *p) noexcept { free (p); } @@ -122,7 +122,7 @@ operator delete (void *p, std::size_t) noexcept } void -operator delete[] (void *p) +operator delete[] (void *p) noexcept { return ::operator delete (p); } |