From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id 179DF3857356; Wed, 20 Apr 2022 15:11:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 179DF3857356 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom Tromey To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Give mapped_index_base a virtual destructor X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: 20386fa32d589332a1d8e6f93ad97392218607c5 X-Git-Newrev: 6555809e3e5ca516c7c1ffca494118ec7fd16934 Message-Id: <20220420151157.179DF3857356@sourceware.org> Date: Wed, 20 Apr 2022 15:11:57 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2022 15:11:57 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D6555809e3e5c= a516c7c1ffca494118ec7fd16934 commit 6555809e3e5ca516c7c1ffca494118ec7fd16934 Author: Tom Tromey Date: Mon Mar 29 17:44:57 2021 -0600 Give mapped_index_base a virtual destructor =20 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 () =3D default; + virtual ~mapped_index_base() =3D default; DISABLE_COPY_AND_ASSIGN (mapped_index_base); =20 /* 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() =3D default; }; =20 #endif /* GDB_DWARF2_MAPPED_INDEX_H */