aboutsummaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2025-03-20 11:16:59 +0100
committerTom de Vries <tdevries@suse.de>2025-03-20 11:16:59 +0100
commitd3d4840e802ef6ee4353872401ded5cc5cf87ecb (patch)
treefb441bab5344d7f1b3ec07912cc6c2888f885325 /gdb/python
parent2084a5debfa7ab82e94baecdb66695eb1627817e (diff)
downloadbinutils-d3d4840e802ef6ee4353872401ded5cc5cf87ecb.zip
binutils-d3d4840e802ef6ee4353872401ded5cc5cf87ecb.tar.gz
binutils-d3d4840e802ef6ee4353872401ded5cc5cf87ecb.tar.bz2
[gdb/build] Fix build with gcc 9
Since commit a691853148f ("gdb/python: introduce gdbpy_registry"), when building gdb with gcc 9, I run into: ... In file included from gdb/varobj.c:38:0: gdb/python/python-internal.h:1211:47: error: expected ‘;’ before ‘<’ token using StorageKey = typename registry<O>::key<Storage>; ^ ... due to this code: ... template <typename Storage> class gdbpy_registry { ... template<typename O> using StorageKey = typename registry<O>::key<Storage>; template<typename O> Storage *get_storage (O *owner, const StorageKey<O> &key) const { ... } ... } ... As an experiment, I tried out eliminating the type alias: ... template<typename O> Storage *get_storage (O *owner, const typename registry<O>::key<Storage> &key) const { ... } ... and got instead: ... In file included from gdb/varobj.c:38:0: gdb/python/python-internal.h:1211:63: error: non-template ‘key’ used as template Storage *get_storage (O *owner, const typename registry<O>::key<Storage> &key) const ^~~ gdb/python/python-internal.h:1211:63: note: use ‘registry<O>::template key’ \ to indicate that it is a template ... Following that suggestion, I tried: ... template<typename O> Storage * get_storage (O *owner, const typename registry<O>::template key<Storage> &key) const { ... } ... which fixed the problem. Likewise, adding the template keyword in the type alias fixes the original problem, so fix it like that. Tested on x86_64-linux.
Diffstat (limited to 'gdb/python')
-rw-r--r--gdb/python/python-internal.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h
index 5e67073..3f1a206 100644
--- a/gdb/python/python-internal.h
+++ b/gdb/python/python-internal.h
@@ -1208,7 +1208,7 @@ public:
private:
template<typename O>
- using StorageKey = typename registry<O>::key<Storage>;
+ using StorageKey = typename registry<O>::template key<Storage>;
template<typename O>
Storage *get_storage (O *owner, const StorageKey<O> &key) const