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] Allow registry to refer to const types
Date: Thu,  4 Aug 2022 19:33:49 +0000 (GMT)	[thread overview]
Message-ID: <20220804193349.84F903858407@sourceware.org> (raw)

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

commit 8b1540430107b0752485ab9e6a841dbbacd45681
Author: Tom Tromey <tom@tromey.com>
Date:   Wed Jun 1 14:52:28 2022 -0600

    Allow registry to refer to const types
    
    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<T> *reg_obj = registry_accessor<T>::get (obj);
-      reg_obj->set (m_key, data);
+      reg_obj->set (m_key, (typename std::remove_const<DATA> *) data);
     }
 
     /* If this key uses the default deleter, then this method is


                 reply	other threads:[~2022-08-04 19:33 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=20220804193349.84F903858407@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).