From: Tom de Vries Date: Wed, 19 Jun 2019 14:56:23 +0000 (+0200) Subject: [gdb] Fix build breaker with gcc 4.8 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f23f598e28ad39dac7ae87cdc400d2f6b27dc403;p=binutils-gdb.git [gdb] Fix build breaker with gcc 4.8 When compiling with gcc 4.8, we run into: ... /usr/include/c++/4.8/bits/unordered_map.h:100:18: required from \ ‘class std::unordered_map >’ src/gdb/dwarf2read.h:260:5: required from here /usr/include/c++/4.8/bits/hashtable_policy.h:1070:12: error: invalid use of \ incomplete type ‘struct std::hash’ ... Fix this by setting the Hash template parameter of the unordered_map to gdb::hash_enum, rather than using the default std::hash. Build and reg-tested on x86_64-linux with gcc 4.8. gdb/ChangeLog: 2019-06-19 Tom de Vries * dwarf2read.h (abstract_to_concrete): Change type to std::unordered_map, gdb::hash_enum>. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c40b7d4574e..0937823a329 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2019-06-19 Tom de Vries + + * dwarf2read.h (abstract_to_concrete): Change type to + std::unordered_map, + gdb::hash_enum>. + 2019-06-19 Tom Tromey * ada-lang.c (ada_evaluate_subexp) : Handle diff --git a/gdb/dwarf2read.h b/gdb/dwarf2read.h index 776860e454d..7113cfd3848 100644 --- a/gdb/dwarf2read.h +++ b/gdb/dwarf2read.h @@ -24,6 +24,7 @@ #include "dwarf-index-cache.h" #include "filename-seen-cache.h" #include "gdb_obstack.h" +#include "common/hash_enum.h" /* Hold 'maintenance (set|show) dwarf' commands. */ extern struct cmd_list_element *set_dwarf_cmdlist; @@ -256,7 +257,8 @@ public: /* Mapping from abstract origin DIE to concrete DIEs that reference it as DW_AT_abstract_origin. */ - std::unordered_map> + std::unordered_map, \ + gdb::hash_enum> \ abstract_to_concrete; };