• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GCC with patches for OS216


Commit MetaInfo

Revision5dfb5e5be885ef50cf5a80aec09f9d8390ddc499 (tree)
Time2018-03-21 06:45:14
AuthorFrançois Dumont <fdumont@gcc....>
CommiterFrançois Dumont

Log Message

re PR libstdc++/84998 (std::hash<std::bitset<N>> fails in Debug Mode)

2018-03-20 François Dumont <fdumont@gcc.gnu.org>

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

Change Summary

Incremental Difference

--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,19 @@
1+2018-03-20 François Dumont <fdumont@gcc.gnu.org>
2+
3+ PR libstdc++/84998
4+ * include/bits/stl_bvector.h: Fix std::hash friend declaration.
5+ * include/std/bitset: Likewise.
6+ * include/bits/stl_map.h (std::map<>): Fix _Rb_tree_merge_helper friend
7+ declaration.
8+ * include/bits/stl_multimap.h (std::multimap<>): Likewise.
9+ * include/bits/stl_multiset.h (std::multiset<>): Likewise.
10+ * include/bits/stl_set.h (std::set<>): Likewise.
11+ * include/bits/unordered_map.h (std::unordered_map<>): Fix
12+ _Hash_merge_helper friend declaration.
13+ (std::unordered_multimap<>): Likewise.
14+ * include/bits/unordered_set.h (std::unordered_set<>): Likewise.
15+ (std::unordered_multiset<>): Likewise.
16+
117 2018-03-19 Gerald Pfeifer <gerald@pfeifer.com>
218
319 * doc/xml/api.xml: www.fsf.org has moved to https. Also omit
@@ -8,7 +24,8 @@
824 * doc/xml/manual/spine.xml: Ditto.
925 * doc/xml/spine.xml: Ditto.
1026
11-2018-03-19 Gerald Pfeifer <gerald@pfeifer.com>
27+2018-03-19 Gerald Pfeifer <gerald@pfeifer.com>
28+
1229 * doc/xml/manual/documentation_hacking.xml: Adjust link to
1330 docbook.org.
1431
--- a/libstdc++-v3/include/bits/stl_bvector.h
+++ b/libstdc++-v3/include/bits/stl_bvector.h
@@ -58,6 +58,7 @@
5858
5959 #if __cplusplus >= 201103L
6060 #include <initializer_list>
61+#include <bits/functional_hash.h>
6162 #endif
6263
6364 namespace std _GLIBCXX_VISIBILITY(default)
@@ -591,7 +592,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
591592 typedef typename _Base::_Bit_alloc_traits _Bit_alloc_traits;
592593
593594 #if __cplusplus >= 201103L
594- template<typename> friend struct hash;
595+ friend struct std::hash<vector>;
595596 #endif
596597
597598 public:
@@ -1313,8 +1314,6 @@ _GLIBCXX_END_NAMESPACE_VERSION
13131314
13141315 #if __cplusplus >= 201103L
13151316
1316-#include <bits/functional_hash.h>
1317-
13181317 namespace std _GLIBCXX_VISIBILITY(default)
13191318 {
13201319 _GLIBCXX_BEGIN_NAMESPACE_VERSION
--- a/libstdc++-v3/include/bits/stl_map.h
+++ b/libstdc++-v3/include/bits/stl_map.h
@@ -633,7 +633,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
633633 { return _M_t._M_reinsert_node_hint_unique(__hint, std::move(__nh)); }
634634
635635 template<typename, typename>
636- friend class _Rb_tree_merge_helper;
636+ friend class std::_Rb_tree_merge_helper;
637637
638638 template<typename _C2>
639639 void
--- a/libstdc++-v3/include/bits/stl_multimap.h
+++ b/libstdc++-v3/include/bits/stl_multimap.h
@@ -651,7 +651,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
651651 { return _M_t._M_reinsert_node_hint_equal(__hint, std::move(__nh)); }
652652
653653 template<typename, typename>
654- friend class _Rb_tree_merge_helper;
654+ friend class std::_Rb_tree_merge_helper;
655655
656656 template<typename _C2>
657657 void
--- a/libstdc++-v3/include/bits/stl_multiset.h
+++ b/libstdc++-v3/include/bits/stl_multiset.h
@@ -589,7 +589,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
589589 { return _M_t._M_reinsert_node_hint_equal(__hint, std::move(__nh)); }
590590
591591 template<typename, typename>
592- friend class _Rb_tree_merge_helper;
592+ friend class std::_Rb_tree_merge_helper;
593593
594594 template<typename _Compare1>
595595 void
--- a/libstdc++-v3/include/bits/stl_set.h
+++ b/libstdc++-v3/include/bits/stl_set.h
@@ -604,7 +604,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
604604 { return _M_t._M_reinsert_node_hint_unique(__hint, std::move(__nh)); }
605605
606606 template<typename, typename>
607- friend class _Rb_tree_merge_helper;
607+ friend class std::_Rb_tree_merge_helper;
608608
609609 template<typename _Compare1>
610610 void
--- a/libstdc++-v3/include/bits/unordered_map.h
+++ b/libstdc++-v3/include/bits/unordered_map.h
@@ -862,7 +862,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
862862
863863 #if __cplusplus > 201402L
864864 template<typename, typename, typename>
865- friend class _Hash_merge_helper;
865+ friend class std::_Hash_merge_helper;
866866
867867 template<typename _H2, typename _P2>
868868 void
@@ -1742,7 +1742,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
17421742
17431743 #if __cplusplus > 201402L
17441744 template<typename, typename, typename>
1745- friend class _Hash_merge_helper;
1745+ friend class std::_Hash_merge_helper;
17461746
17471747 template<typename _H2, typename _P2>
17481748 void
--- a/libstdc++-v3/include/bits/unordered_set.h
+++ b/libstdc++-v3/include/bits/unordered_set.h
@@ -588,7 +588,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
588588
589589 #if __cplusplus > 201402L
590590 template<typename, typename, typename>
591- friend class _Hash_merge_helper;
591+ friend class std::_Hash_merge_helper;
592592
593593 template<typename _H2, typename _P2>
594594 void
@@ -1368,7 +1368,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
13681368
13691369 #if __cplusplus > 201402L
13701370 template<typename, typename, typename>
1371- friend class _Hash_merge_helper;
1371+ friend class std::_Hash_merge_helper;
13721372
13731373 template<typename _H2, typename _P2>
13741374 void
--- a/libstdc++-v3/include/debug/vector
+++ b/libstdc++-v3/include/debug/vector
@@ -770,6 +770,8 @@ namespace __debug
770770 } // namespace __debug
771771
772772 #if __cplusplus >= 201103L
773+_GLIBCXX_BEGIN_NAMESPACE_VERSION
774+
773775 // DR 1182.
774776 /// std::hash specialization for vector<bool>.
775777 template<typename _Alloc>
@@ -780,6 +782,8 @@ namespace __debug
780782 operator()(const __debug::vector<bool, _Alloc>& __b) const noexcept
781783 { return std::hash<_GLIBCXX_STD_C::vector<bool, _Alloc>>()(__b); }
782784 };
785+
786+_GLIBCXX_END_NAMESPACE_VERSION
783787 #endif
784788
785789 } // namespace std
--- a/libstdc++-v3/include/std/bitset
+++ b/libstdc++-v3/include/std/bitset
@@ -50,6 +50,10 @@
5050 #include <iosfwd>
5151 #include <bits/cxxabi_forced.h>
5252
53+#if __cplusplus >= 201103L
54+# include <bits/functional_hash.h>
55+#endif
56+
5357 #define _GLIBCXX_BITSET_BITS_PER_WORD (__CHAR_BIT__ * __SIZEOF_LONG__)
5458 #define _GLIBCXX_BITSET_WORDS(__n) \
5559 ((__n) / _GLIBCXX_BITSET_BITS_PER_WORD + \
@@ -779,7 +783,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
779783 }
780784
781785 #if __cplusplus >= 201103L
782- template<typename> friend struct hash;
786+ friend struct std::hash<bitset>;
783787 #endif
784788
785789 public:
@@ -1549,8 +1553,6 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
15491553
15501554 #if __cplusplus >= 201103L
15511555
1552-#include <bits/functional_hash.h>
1553-
15541556 namespace std _GLIBCXX_VISIBILITY(default)
15551557 {
15561558 _GLIBCXX_BEGIN_NAMESPACE_VERSION