From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id 84F903858407; Thu, 4 Aug 2022 19:33:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 84F903858407 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] Allow registry to refer to const types X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: b987c79ac133c303adefad5caff19c530f86b7a4 X-Git-Newrev: 8b1540430107b0752485ab9e6a841dbbacd45681 Message-Id: <20220804193349.84F903858407@sourceware.org> Date: Thu, 4 Aug 2022 19:33:49 +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: Thu, 04 Aug 2022 19:33:49 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D8b1540430107= b0752485ab9e6a841dbbacd45681 commit 8b1540430107b0752485ab9e6a841dbbacd45681 Author: Tom Tromey Date: Wed Jun 1 14:52:28 2022 -0600 Allow registry to refer to const types =20 So far, the registry hasn't been used to refer to a 'const' type, but this changes with the gdbarch change. This patch arranges to let the registry store a pointer-to-const, by removing const in the 'set' method. Diff: --- gdb/registry.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/registry.h b/gdb/registry.h index 54aad6b7c4d..3df4749ce24 100644 --- a/gdb/registry.h +++ b/gdb/registry.h @@ -117,7 +117,7 @@ public: void set (T *obj, DATA *data) const { registry *reg_obj =3D registry_accessor::get (obj); - reg_obj->set (m_key, data); + reg_obj->set (m_key, (typename std::remove_const *) data); } =20 /* If this key uses the default deleter, then this method is