From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id B9D973858D1E; Mon, 13 Feb 2023 22:31:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B9D973858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1676327472; bh=UDCt1RuFTTFBrq+fveDcVemJa3Qx+/msWPflPayY6a4=; h=From:To:Subject:Date:From; b=KQKrHz47aU7yuXW4/ocKtFfacCUhoiXd5IIFiKgtrKzRBynLwauJWwcpZbb2OvgM+ nrEffY2QBRD9bDZRbHLDIuw4K9flKCPprhvBvGDnTUIVK73tJUWEj/N2uss/Xp6DXR 0Jw9GDfTsKrCSY7ott5Z9fnCM/ymFlLTnBXJZDOs= 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] Make ~value private X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: 8f4135314ae6e1a98a36295c85af5b246dfa00ff X-Git-Newrev: 43b5fba22365c6ddd0d60324833f279364b577e7 Message-Id: <20230213223112.B9D973858D1E@sourceware.org> Date: Mon, 13 Feb 2023 22:31:12 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D43b5fba22365= c6ddd0d60324833f279364b577e7 commit 43b5fba22365c6ddd0d60324833f279364b577e7 Author: Tom Tromey Date: Wed Feb 1 08:34:58 2023 -0700 Make ~value private =20 At the end of this series, I belatedly realized that values should only be destroyed by value_decref. This patch marks the the destructor private to enforce this. =20 Approved-By: Simon Marchi Diff: --- gdb/value.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/gdb/value.h b/gdb/value.h index 7708530ddcc..07230662fdd 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -143,6 +143,12 @@ private: { } =20 + /* Values can only be destroyed via the reference-counting + mechanism. */ + ~value (); + + DISABLE_COPY_AND_ASSIGN (value); + public: =20 /* Allocate a lazy value for type TYPE. Its actual content is @@ -170,10 +176,6 @@ public: storage. */ struct value *copy () const; =20 - ~value (); - - DISABLE_COPY_AND_ASSIGN (value); - /* Type of the value. */ struct type *type () const { return m_type; }