From 5dfb5e5be885ef50cf5a80aec09f9d8390ddc499 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fran=C3=A7ois=20Dumont?= Date: Tue, 20 Mar 2018 21:45:14 +0000 Subject: [PATCH] re PR libstdc++/84998 (std::hash> fails in Debug Mode) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 2018-03-20 François Dumont PR libstdc++/84998 * include/bits/stl_bvector.h: Fix std::hash friend declaration. * include/std/bitset: Likewise. * include/bits/stl_map.h (std::map<>): Fix _Rb_tree_merge_helper friend declaration. * include/bits/stl_multimap.h (std::multimap<>): Likewise. * include/bits/stl_multiset.h (std::multiset<>): Likewise. * include/bits/stl_set.h (std::set<>): Likewise. * include/bits/unordered_map.h (std::unordered_map<>): Fix _Hash_merge_helper friend declaration. (std::unordered_multimap<>): Likewise. * include/bits/unordered_set.h (std::unordered_set<>): Likewise. (std::unordered_multiset<>): Likewise. From-SVN: r258693 --- libstdc++-v3/ChangeLog | 19 ++++++++++++++++++- libstdc++-v3/include/bits/stl_bvector.h | 5 ++--- libstdc++-v3/include/bits/stl_map.h | 2 +- libstdc++-v3/include/bits/stl_multimap.h | 2 +- libstdc++-v3/include/bits/stl_multiset.h | 2 +- libstdc++-v3/include/bits/stl_set.h | 2 +- libstdc++-v3/include/bits/unordered_map.h | 4 ++-- libstdc++-v3/include/bits/unordered_set.h | 4 ++-- libstdc++-v3/include/debug/vector | 4 ++++ libstdc++-v3/include/std/bitset | 8 +++++--- 10 files changed, 37 insertions(+), 15 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 2c5c6c6c1ef..7ac98fb2143 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,19 @@ +2018-03-20 François Dumont + + PR libstdc++/84998 + * include/bits/stl_bvector.h: Fix std::hash friend declaration. + * include/std/bitset: Likewise. + * include/bits/stl_map.h (std::map<>): Fix _Rb_tree_merge_helper friend + declaration. + * include/bits/stl_multimap.h (std::multimap<>): Likewise. + * include/bits/stl_multiset.h (std::multiset<>): Likewise. + * include/bits/stl_set.h (std::set<>): Likewise. + * include/bits/unordered_map.h (std::unordered_map<>): Fix + _Hash_merge_helper friend declaration. + (std::unordered_multimap<>): Likewise. + * include/bits/unordered_set.h (std::unordered_set<>): Likewise. + (std::unordered_multiset<>): Likewise. + 2018-03-19 Gerald Pfeifer * doc/xml/api.xml: www.fsf.org has moved to https. Also omit @@ -8,7 +24,8 @@ * doc/xml/manual/spine.xml: Ditto. * doc/xml/spine.xml: Ditto. -2018-03-19 Gerald Pfeifer +2018-03-19 Gerald Pfeifer + * doc/xml/manual/documentation_hacking.xml: Adjust link to docbook.org. diff --git a/libstdc++-v3/include/bits/stl_bvector.h b/libstdc++-v3/include/bits/stl_bvector.h index 00a179f3a89..de723edf50c 100644 --- a/libstdc++-v3/include/bits/stl_bvector.h +++ b/libstdc++-v3/include/bits/stl_bvector.h @@ -58,6 +58,7 @@ #if __cplusplus >= 201103L #include +#include #endif namespace std _GLIBCXX_VISIBILITY(default) @@ -591,7 +592,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER typedef typename _Base::_Bit_alloc_traits _Bit_alloc_traits; #if __cplusplus >= 201103L - template friend struct hash; + friend struct std::hash; #endif public: @@ -1313,8 +1314,6 @@ _GLIBCXX_END_NAMESPACE_VERSION #if __cplusplus >= 201103L -#include - namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION diff --git a/libstdc++-v3/include/bits/stl_map.h b/libstdc++-v3/include/bits/stl_map.h index 24d7f422271..a4a026ed34a 100644 --- a/libstdc++-v3/include/bits/stl_map.h +++ b/libstdc++-v3/include/bits/stl_map.h @@ -633,7 +633,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER { return _M_t._M_reinsert_node_hint_unique(__hint, std::move(__nh)); } template - friend class _Rb_tree_merge_helper; + friend class std::_Rb_tree_merge_helper; template void diff --git a/libstdc++-v3/include/bits/stl_multimap.h b/libstdc++-v3/include/bits/stl_multimap.h index 38071fe7d12..fc8f454723d 100644 --- a/libstdc++-v3/include/bits/stl_multimap.h +++ b/libstdc++-v3/include/bits/stl_multimap.h @@ -651,7 +651,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER { return _M_t._M_reinsert_node_hint_equal(__hint, std::move(__nh)); } template - friend class _Rb_tree_merge_helper; + friend class std::_Rb_tree_merge_helper; template void diff --git a/libstdc++-v3/include/bits/stl_multiset.h b/libstdc++-v3/include/bits/stl_multiset.h index 1039612fb04..f41f56c9485 100644 --- a/libstdc++-v3/include/bits/stl_multiset.h +++ b/libstdc++-v3/include/bits/stl_multiset.h @@ -589,7 +589,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER { return _M_t._M_reinsert_node_hint_equal(__hint, std::move(__nh)); } template - friend class _Rb_tree_merge_helper; + friend class std::_Rb_tree_merge_helper; template void diff --git a/libstdc++-v3/include/bits/stl_set.h b/libstdc++-v3/include/bits/stl_set.h index 0a40f0661c0..2e332efa477 100644 --- a/libstdc++-v3/include/bits/stl_set.h +++ b/libstdc++-v3/include/bits/stl_set.h @@ -604,7 +604,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER { return _M_t._M_reinsert_node_hint_unique(__hint, std::move(__nh)); } template - friend class _Rb_tree_merge_helper; + friend class std::_Rb_tree_merge_helper; template void diff --git a/libstdc++-v3/include/bits/unordered_map.h b/libstdc++-v3/include/bits/unordered_map.h index b757ff2a72c..07aad9e5e19 100644 --- a/libstdc++-v3/include/bits/unordered_map.h +++ b/libstdc++-v3/include/bits/unordered_map.h @@ -862,7 +862,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER #if __cplusplus > 201402L template - friend class _Hash_merge_helper; + friend class std::_Hash_merge_helper; template void @@ -1742,7 +1742,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER #if __cplusplus > 201402L template - friend class _Hash_merge_helper; + friend class std::_Hash_merge_helper; template void diff --git a/libstdc++-v3/include/bits/unordered_set.h b/libstdc++-v3/include/bits/unordered_set.h index 77942a3c306..c9ac4ad57e3 100644 --- a/libstdc++-v3/include/bits/unordered_set.h +++ b/libstdc++-v3/include/bits/unordered_set.h @@ -588,7 +588,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER #if __cplusplus > 201402L template - friend class _Hash_merge_helper; + friend class std::_Hash_merge_helper; template void @@ -1368,7 +1368,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER #if __cplusplus > 201402L template - friend class _Hash_merge_helper; + friend class std::_Hash_merge_helper; template void diff --git a/libstdc++-v3/include/debug/vector b/libstdc++-v3/include/debug/vector index fa79379f677..52892653728 100644 --- a/libstdc++-v3/include/debug/vector +++ b/libstdc++-v3/include/debug/vector @@ -770,6 +770,8 @@ namespace __debug } // namespace __debug #if __cplusplus >= 201103L +_GLIBCXX_BEGIN_NAMESPACE_VERSION + // DR 1182. /// std::hash specialization for vector. template @@ -780,6 +782,8 @@ namespace __debug operator()(const __debug::vector& __b) const noexcept { return std::hash<_GLIBCXX_STD_C::vector>()(__b); } }; + +_GLIBCXX_END_NAMESPACE_VERSION #endif } // namespace std diff --git a/libstdc++-v3/include/std/bitset b/libstdc++-v3/include/std/bitset index 630602d48e7..e598ea312a7 100644 --- a/libstdc++-v3/include/std/bitset +++ b/libstdc++-v3/include/std/bitset @@ -50,6 +50,10 @@ #include #include +#if __cplusplus >= 201103L +# include +#endif + #define _GLIBCXX_BITSET_BITS_PER_WORD (__CHAR_BIT__ * __SIZEOF_LONG__) #define _GLIBCXX_BITSET_WORDS(__n) \ ((__n) / _GLIBCXX_BITSET_BITS_PER_WORD + \ @@ -779,7 +783,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER } #if __cplusplus >= 201103L - template friend struct hash; + friend struct std::hash; #endif public: @@ -1549,8 +1553,6 @@ _GLIBCXX_END_NAMESPACE_CONTAINER #if __cplusplus >= 201103L -#include - namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION -- 2.30.2