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] Make ~value private
Date: Mon, 13 Feb 2023 22:31:12 +0000 (GMT)	[thread overview]
Message-ID: <20230213223112.B9D973858D1E@sourceware.org> (raw)

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

commit 43b5fba22365c6ddd0d60324833f279364b577e7
Author: Tom Tromey <tom@tromey.com>
Date:   Wed Feb 1 08:34:58 2023 -0700

    Make ~value private
    
    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.
    
    Approved-By: Simon Marchi <simon.marchi@efficios.com>

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:
   {
   }
 
+  /* Values can only be destroyed via the reference-counting
+     mechanism.  */
+  ~value ();
+
+  DISABLE_COPY_AND_ASSIGN (value);
+
 public:
 
   /* Allocate a lazy value for type TYPE.  Its actual content is
@@ -170,10 +176,6 @@ public:
      storage.  */
   struct value *copy () const;
 
-  ~value ();
-
-  DISABLE_COPY_AND_ASSIGN (value);
-
   /* Type of the value.  */
   struct type *type () const
   { return m_type; }

                 reply	other threads:[~2023-02-13 22:31 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=20230213223112.B9D973858D1E@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).