From: Tom Tromey Date: Wed, 1 Feb 2023 15:34:58 +0000 (-0700) Subject: Make ~value private X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=43b5fba22365c6ddd0d60324833f279364b577e7;p=binutils-gdb.git 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 --- 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; }