diff --git a/libstdc++-v3/include/bits/hashtable_policy.h b/libstdc++-v3/include/bits/hashtable_policy.h index 3b60eb9ae72..0f0b0f9ea51 100644 --- a/libstdc++-v3/include/bits/hashtable_policy.h +++ b/libstdc++-v3/include/bits/hashtable_policy.h @@ -812,6 +812,17 @@ namespace __detail return __pos->second; } + // Partial specialization for unordered_map, see PR 104174. + template + struct _Map_base, + _Alloc, _Select1st, _Equal, _Hash, + _RangeHash, _Unused, _RehashPolicy, _Traits, __uniq> + : _Map_base<_Key, pair, _Alloc, _Select1st, _Equal, _Hash, + _RangeHash, _Unused, _RehashPolicy, _Traits, __uniq> + { }; + /** * Primary class template _Insert_base. * diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/104174.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/104174.cc new file mode 100644 index 00000000000..4007425bf74 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/104174.cc @@ -0,0 +1,4 @@ +// { dg-do compile { target c++11 } } +// PR libstdc++/104174 unordered_map fails +#include +std::unordered_map> m;