public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Allow registry to refer to const types
@ 2022-08-04 19:33 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2022-08-04 19:33 UTC (permalink / raw)
  To: gdb-cvs

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-08-04 19:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-04 19:33 [binutils-gdb] Allow registry to refer to const types Tom Tromey

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).