GCC with patches for OS216
修订版 | 5dfb5e5be885ef50cf5a80aec09f9d8390ddc499 (tree) |
---|---|
时间 | 2018-03-21 06:45:14 |
作者 | François Dumont <fdumont@gcc....> |
Commiter | François Dumont |
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
@@ -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 | + | |
1 | 17 | 2018-03-19 Gerald Pfeifer <gerald@pfeifer.com> |
2 | 18 | |
3 | 19 | * doc/xml/api.xml: www.fsf.org has moved to https. Also omit |
@@ -8,7 +24,8 @@ | ||
8 | 24 | * doc/xml/manual/spine.xml: Ditto. |
9 | 25 | * doc/xml/spine.xml: Ditto. |
10 | 26 | |
11 | -2018-03-19 Gerald Pfeifer <gerald@pfeifer.com> | |
27 | +2018-03-19 Gerald Pfeifer <gerald@pfeifer.com> | |
28 | + | |
12 | 29 | * doc/xml/manual/documentation_hacking.xml: Adjust link to |
13 | 30 | docbook.org. |
14 | 31 |
@@ -58,6 +58,7 @@ | ||
58 | 58 | |
59 | 59 | #if __cplusplus >= 201103L |
60 | 60 | #include <initializer_list> |
61 | +#include <bits/functional_hash.h> | |
61 | 62 | #endif |
62 | 63 | |
63 | 64 | namespace std _GLIBCXX_VISIBILITY(default) |
@@ -591,7 +592,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER | ||
591 | 592 | typedef typename _Base::_Bit_alloc_traits _Bit_alloc_traits; |
592 | 593 | |
593 | 594 | #if __cplusplus >= 201103L |
594 | - template<typename> friend struct hash; | |
595 | + friend struct std::hash<vector>; | |
595 | 596 | #endif |
596 | 597 | |
597 | 598 | public: |
@@ -1313,8 +1314,6 @@ _GLIBCXX_END_NAMESPACE_VERSION | ||
1313 | 1314 | |
1314 | 1315 | #if __cplusplus >= 201103L |
1315 | 1316 | |
1316 | -#include <bits/functional_hash.h> | |
1317 | - | |
1318 | 1317 | namespace std _GLIBCXX_VISIBILITY(default) |
1319 | 1318 | { |
1320 | 1319 | _GLIBCXX_BEGIN_NAMESPACE_VERSION |
@@ -633,7 +633,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER | ||
633 | 633 | { return _M_t._M_reinsert_node_hint_unique(__hint, std::move(__nh)); } |
634 | 634 | |
635 | 635 | template<typename, typename> |
636 | - friend class _Rb_tree_merge_helper; | |
636 | + friend class std::_Rb_tree_merge_helper; | |
637 | 637 | |
638 | 638 | template<typename _C2> |
639 | 639 | void |
@@ -651,7 +651,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER | ||
651 | 651 | { return _M_t._M_reinsert_node_hint_equal(__hint, std::move(__nh)); } |
652 | 652 | |
653 | 653 | template<typename, typename> |
654 | - friend class _Rb_tree_merge_helper; | |
654 | + friend class std::_Rb_tree_merge_helper; | |
655 | 655 | |
656 | 656 | template<typename _C2> |
657 | 657 | void |
@@ -589,7 +589,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER | ||
589 | 589 | { return _M_t._M_reinsert_node_hint_equal(__hint, std::move(__nh)); } |
590 | 590 | |
591 | 591 | template<typename, typename> |
592 | - friend class _Rb_tree_merge_helper; | |
592 | + friend class std::_Rb_tree_merge_helper; | |
593 | 593 | |
594 | 594 | template<typename _Compare1> |
595 | 595 | void |
@@ -604,7 +604,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER | ||
604 | 604 | { return _M_t._M_reinsert_node_hint_unique(__hint, std::move(__nh)); } |
605 | 605 | |
606 | 606 | template<typename, typename> |
607 | - friend class _Rb_tree_merge_helper; | |
607 | + friend class std::_Rb_tree_merge_helper; | |
608 | 608 | |
609 | 609 | template<typename _Compare1> |
610 | 610 | void |
@@ -862,7 +862,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER | ||
862 | 862 | |
863 | 863 | #if __cplusplus > 201402L |
864 | 864 | template<typename, typename, typename> |
865 | - friend class _Hash_merge_helper; | |
865 | + friend class std::_Hash_merge_helper; | |
866 | 866 | |
867 | 867 | template<typename _H2, typename _P2> |
868 | 868 | void |
@@ -1742,7 +1742,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER | ||
1742 | 1742 | |
1743 | 1743 | #if __cplusplus > 201402L |
1744 | 1744 | template<typename, typename, typename> |
1745 | - friend class _Hash_merge_helper; | |
1745 | + friend class std::_Hash_merge_helper; | |
1746 | 1746 | |
1747 | 1747 | template<typename _H2, typename _P2> |
1748 | 1748 | void |
@@ -588,7 +588,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER | ||
588 | 588 | |
589 | 589 | #if __cplusplus > 201402L |
590 | 590 | template<typename, typename, typename> |
591 | - friend class _Hash_merge_helper; | |
591 | + friend class std::_Hash_merge_helper; | |
592 | 592 | |
593 | 593 | template<typename _H2, typename _P2> |
594 | 594 | void |
@@ -1368,7 +1368,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER | ||
1368 | 1368 | |
1369 | 1369 | #if __cplusplus > 201402L |
1370 | 1370 | template<typename, typename, typename> |
1371 | - friend class _Hash_merge_helper; | |
1371 | + friend class std::_Hash_merge_helper; | |
1372 | 1372 | |
1373 | 1373 | template<typename _H2, typename _P2> |
1374 | 1374 | void |
@@ -770,6 +770,8 @@ namespace __debug | ||
770 | 770 | } // namespace __debug |
771 | 771 | |
772 | 772 | #if __cplusplus >= 201103L |
773 | +_GLIBCXX_BEGIN_NAMESPACE_VERSION | |
774 | + | |
773 | 775 | // DR 1182. |
774 | 776 | /// std::hash specialization for vector<bool>. |
775 | 777 | template<typename _Alloc> |
@@ -780,6 +782,8 @@ namespace __debug | ||
780 | 782 | operator()(const __debug::vector<bool, _Alloc>& __b) const noexcept |
781 | 783 | { return std::hash<_GLIBCXX_STD_C::vector<bool, _Alloc>>()(__b); } |
782 | 784 | }; |
785 | + | |
786 | +_GLIBCXX_END_NAMESPACE_VERSION | |
783 | 787 | #endif |
784 | 788 | |
785 | 789 | } // namespace std |
@@ -50,6 +50,10 @@ | ||
50 | 50 | #include <iosfwd> |
51 | 51 | #include <bits/cxxabi_forced.h> |
52 | 52 | |
53 | +#if __cplusplus >= 201103L | |
54 | +# include <bits/functional_hash.h> | |
55 | +#endif | |
56 | + | |
53 | 57 | #define _GLIBCXX_BITSET_BITS_PER_WORD (__CHAR_BIT__ * __SIZEOF_LONG__) |
54 | 58 | #define _GLIBCXX_BITSET_WORDS(__n) \ |
55 | 59 | ((__n) / _GLIBCXX_BITSET_BITS_PER_WORD + \ |
@@ -779,7 +783,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER | ||
779 | 783 | } |
780 | 784 | |
781 | 785 | #if __cplusplus >= 201103L |
782 | - template<typename> friend struct hash; | |
786 | + friend struct std::hash<bitset>; | |
783 | 787 | #endif |
784 | 788 | |
785 | 789 | public: |
@@ -1549,8 +1553,6 @@ _GLIBCXX_END_NAMESPACE_CONTAINER | ||
1549 | 1553 | |
1550 | 1554 | #if __cplusplus >= 201103L |
1551 | 1555 | |
1552 | -#include <bits/functional_hash.h> | |
1553 | - | |
1554 | 1556 | namespace std _GLIBCXX_VISIBILITY(default) |
1555 | 1557 | { |
1556 | 1558 | _GLIBCXX_BEGIN_NAMESPACE_VERSION |