mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-15 04:31:49 +08:00
30970df7d5
Clang 6 shows this warning In file included from /home/emaisin/src/binutils-gdb/gdb/common/selftest.c:19: In file included from /home/emaisin/src/binutils-gdb/gdb/common/common-defs.h:92: In file included from /home/emaisin/src/binutils-gdb/gdb/common/gdb_unique_ptr.h:23: In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/memory:81: /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/bits/unique_ptr.h:76:2: error: delete called on 'selftests::selftest' that is abstract but has non-virtual destructor [-Werror,-Wdelete-non-virtual-dtor] delete __ptr; ^ /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/bits/unique_ptr.h:236:4: note: in instantiation of member function 'std::default_delete<selftests::selftest>::operator()' requested here get_deleter()(__ptr); ^ /home/emaisin/src/binutils-gdb/gdb/common/selftest.c:57:17: note: in instantiation of member function 'std::unique_ptr<selftests::selftest, std::default_delete<selftests::selftest> >::~unique_ptr' requested here tests[name] = std::unique_ptr<selftest> (test); ^ The error is legitimate, we (the unique_ptr) are deleting selftest objects through the base pointer, so technically the destructor should be virtual, so that the destructor of the subclass is invoked. gdb/ChangeLog: * common/selftest.h (struct selftest): Add virtual destructor. |
||
---|---|---|
.. | ||
agent.c | ||
agent.h | ||
array-view.h | ||
ax.def | ||
break-common.h | ||
btrace-common.c | ||
btrace-common.h | ||
buffer.c | ||
buffer.h | ||
byte-vector.h | ||
cleanups.c | ||
cleanups.h | ||
common-debug.c | ||
common-debug.h | ||
common-defs.h | ||
common-exceptions.c | ||
common-exceptions.h | ||
common-gdbthread.h | ||
common-inferior.h | ||
common-regcache.c | ||
common-regcache.h | ||
common-types.h | ||
common-utils.c | ||
common-utils.h | ||
common.host | ||
common.m4 | ||
create-version.sh | ||
def-vector.h | ||
default-init-alloc.h | ||
diagnostics.h | ||
enum-flags.h | ||
environ.c | ||
environ.h | ||
errors.c | ||
errors.h | ||
fileio.c | ||
fileio.h | ||
filestuff.c | ||
filestuff.h | ||
format.c | ||
format.h | ||
function-view.h | ||
gdb_assert.h | ||
gdb_locale.h | ||
gdb_optional.h | ||
gdb_ref_ptr.h | ||
gdb_setjmp.h | ||
gdb_signals.h | ||
gdb_splay_tree.h | ||
gdb_sys_time.h | ||
gdb_tilde_expand.c | ||
gdb_tilde_expand.h | ||
gdb_unique_ptr.h | ||
gdb_unlinker.h | ||
gdb_vecs.c | ||
gdb_vecs.h | ||
gdb_wait.h | ||
host-defs.h | ||
job-control.c | ||
job-control.h | ||
mingw-strerror.c | ||
new-op.c | ||
offset-type.h | ||
poison.h | ||
posix-strerror.c | ||
preprocessor.h | ||
print-utils.c | ||
print-utils.h | ||
ptid.c | ||
ptid.h | ||
queue.h | ||
refcounted-object.h | ||
rsp-low.c | ||
rsp-low.h | ||
run-time-clock.c | ||
run-time-clock.h | ||
scoped_restore.h | ||
selftest.c | ||
selftest.h | ||
signals-state-save-restore.c | ||
signals-state-save-restore.h | ||
signals.c | ||
symbol.h | ||
traits.h | ||
underlying.h | ||
valid-expr.h | ||
vec.c | ||
vec.h | ||
version.h | ||
x86-xstate.h | ||
xml-utils.c | ||
xml-utils.h |