summaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/bits/hashtable_policy.h
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2020-08-26 17:30:31 +0100
committerJonathan Wakely <jwakely@redhat.com>2020-08-26 17:44:23 +0100
commit9f9c0549dd42e85e2500ca67cef89dddb142c0c7 (patch)
tree51a76f6b33ad81457cbacd2d8a14101f9117cf94 /libstdc++-v3/include/bits/hashtable_policy.h
parentb6cd5c3786cd3cdaa794574518585caba9822b09 (diff)
libstdc++: Fix regression in hash containers
A recent change altered the layout of EBO-helper base classes, resulting in an ambiguity when the hash function and equality predicate are the same type. This modifies the type of one of the base classes, so that we don't get two base classes of the same type. libstdc++-v3/ChangeLog: * include/bits/hashtable_policy.h (_Hash_code_base): Change index of _Hashtable_ebo_helper base class. * testsuite/23_containers/unordered_map/dup_types.cc: New test.
Diffstat (limited to 'libstdc++-v3/include/bits/hashtable_policy.h')
-rw-r--r--libstdc++-v3/include/bits/hashtable_policy.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/libstdc++-v3/include/bits/hashtable_policy.h b/libstdc++-v3/include/bits/hashtable_policy.h
index 38bd5ae4e81..0109ef86a7b 100644
--- a/libstdc++-v3/include/bits/hashtable_policy.h
+++ b/libstdc++-v3/include/bits/hashtable_policy.h
@@ -1190,10 +1190,10 @@ namespace __detail
typename _Hash, typename _RangeHash, typename _Unused>
struct _Hash_code_base<_Key, _Value, _ExtractKey, _Hash, _RangeHash,
_Unused, false>
- : private _Hashtable_ebo_helper<0, _Hash>
+ : private _Hashtable_ebo_helper<1, _Hash>
{
private:
- using __ebo_hash = _Hashtable_ebo_helper<0, _Hash>;
+ using __ebo_hash = _Hashtable_ebo_helper<1, _Hash>;
// Gives the local iterator implementation access to _M_bucket_index().
friend struct _Local_iterator_base<_Key, _Value, _ExtractKey,
@@ -1260,10 +1260,10 @@ namespace __detail
typename _Hash, typename _RangeHash, typename _Unused>
struct _Hash_code_base<_Key, _Value, _ExtractKey, _Hash, _RangeHash,
_Unused, true>
- : private _Hashtable_ebo_helper<0, _Hash>
+ : private _Hashtable_ebo_helper<1, _Hash>
{
private:
- using __ebo_hash = _Hashtable_ebo_helper<0, _Hash>;
+ using __ebo_hash = _Hashtable_ebo_helper<1, _Hash>;
public:
typedef _Hash hasher;