public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
From: Tom Tromey <tromey@sourceware.org>
To: gdb-cvs@sourceware.org
Subject: [binutils-gdb] Give mapped_index_base a virtual destructor
Date: Wed, 20 Apr 2022 15:11:57 +0000 (GMT)	[thread overview]
Message-ID: <20220420151157.179DF3857356@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=6555809e3e5ca516c7c1ffca494118ec7fd16934

commit 6555809e3e5ca516c7c1ffca494118ec7fd16934
Author: Tom Tromey <tom@tromey.com>
Date:   Mon Mar 29 17:44:57 2021 -0600

    Give mapped_index_base a virtual destructor
    
    This changes mapped_index_base to have a virtual destructor, so it can
    be destroyed via its base class.

Diff:
---
 gdb/dwarf2/mapped-index.h | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/gdb/dwarf2/mapped-index.h b/gdb/dwarf2/mapped-index.h
index c2ff27ac4f5..fb6828e43df 100644
--- a/gdb/dwarf2/mapped-index.h
+++ b/gdb/dwarf2/mapped-index.h
@@ -53,6 +53,7 @@ struct name_component
 struct mapped_index_base
 {
   mapped_index_base () = default;
+  virtual ~mapped_index_base() = default;
   DISABLE_COPY_AND_ASSIGN (mapped_index_base);
 
   /* The name_component table (a sorted vector).  See name_component's
@@ -88,10 +89,6 @@ struct mapped_index_base
     find_name_components_bounds (const lookup_name_info &ln_no_params,
 				 enum language lang,
 				 dwarf2_per_objfile *per_objfile) const;
-
-  /* Prevent deleting/destroying via a base class pointer.  */
-protected:
-  ~mapped_index_base() = default;
 };
 
 #endif /* GDB_DWARF2_MAPPED_INDEX_H */


                 reply	other threads:[~2022-04-20 15:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20220420151157.179DF3857356@sourceware.org \
    --to=tromey@sourceware.org \
    --cc=gdb-cvs@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).