Commit c0cb38c2 by François Dumont

re PR libstdc++/89477 (Incorrect CTAD deduction guides for set and multiset)

2019-03-08  François Dumont  <fdumont@gcc.gnu.org>

	PR libstdc++/89477
	* include/debug/map.h (map): Use _RequireNotAllocator to constrain
	parameters in deduction guides.
	* include/debug/multimap.h (multimap): Likewise.
	* include/debug/set.h (multimap): Likewise.
	* include/debug/multiset.h (multimap): Likewise.
	* include/debug/unordered_map (unordered_map): Likewise.
	(unordered_multimap): Likewise.
	* include/debug/unordered_set (unordered_set): Likewise.
	(unordered_multiset): Likewise.

From-SVN: r269479
parent 20a4550c
2019-03-08 François Dumont <fdumont@gcc.gnu.org> 2019-03-08 François Dumont <fdumont@gcc.gnu.org>
PR libstdc++/89477
* include/debug/map.h (map): Use _RequireNotAllocator to constrain
parameters in deduction guides.
* include/debug/multimap.h (multimap): Likewise.
* include/debug/set.h (multimap): Likewise.
* include/debug/multiset.h (multimap): Likewise.
* include/debug/unordered_map (unordered_map): Likewise.
(unordered_multimap): Likewise.
* include/debug/unordered_set (unordered_set): Likewise.
(unordered_multiset): Likewise.
PR libstdc++/89608 PR libstdc++/89608
* include/debug/unordered_map (unordered_map<>::_M_check_rehashed): * include/debug/unordered_map (unordered_map<>::_M_check_rehashed):
Invalidate all iterators in case of rehash. Invalidate all iterators in case of rehash.
......
...@@ -704,6 +704,7 @@ namespace __debug ...@@ -704,6 +704,7 @@ namespace __debug
typename _Compare = less<__iter_key_t<_InputIterator>>, typename _Compare = less<__iter_key_t<_InputIterator>>,
typename _Allocator = allocator<__iter_to_alloc_t<_InputIterator>>, typename _Allocator = allocator<__iter_to_alloc_t<_InputIterator>>,
typename = _RequireInputIter<_InputIterator>, typename = _RequireInputIter<_InputIterator>,
typename = _RequireNotAllocator<_Compare>,
typename = _RequireAllocator<_Allocator>> typename = _RequireAllocator<_Allocator>>
map(_InputIterator, _InputIterator, map(_InputIterator, _InputIterator,
_Compare = _Compare(), _Allocator = _Allocator()) _Compare = _Compare(), _Allocator = _Allocator())
...@@ -712,6 +713,7 @@ namespace __debug ...@@ -712,6 +713,7 @@ namespace __debug
template<typename _Key, typename _Tp, typename _Compare = less<_Key>, template<typename _Key, typename _Tp, typename _Compare = less<_Key>,
typename _Allocator = allocator<pair<const _Key, _Tp>>, typename _Allocator = allocator<pair<const _Key, _Tp>>,
typename = _RequireNotAllocator<_Compare>,
typename = _RequireAllocator<_Allocator>> typename = _RequireAllocator<_Allocator>>
map(initializer_list<pair<_Key, _Tp>>, map(initializer_list<pair<_Key, _Tp>>,
_Compare = _Compare(), _Allocator = _Allocator()) _Compare = _Compare(), _Allocator = _Allocator())
......
...@@ -585,6 +585,7 @@ namespace __debug ...@@ -585,6 +585,7 @@ namespace __debug
typename _Compare = less<__iter_key_t<_InputIterator>>, typename _Compare = less<__iter_key_t<_InputIterator>>,
typename _Allocator = allocator<__iter_to_alloc_t<_InputIterator>>, typename _Allocator = allocator<__iter_to_alloc_t<_InputIterator>>,
typename = _RequireInputIter<_InputIterator>, typename = _RequireInputIter<_InputIterator>,
typename = _RequireNotAllocator<_Compare>,
typename = _RequireAllocator<_Allocator>> typename = _RequireAllocator<_Allocator>>
multimap(_InputIterator, _InputIterator, multimap(_InputIterator, _InputIterator,
_Compare = _Compare(), _Allocator = _Allocator()) _Compare = _Compare(), _Allocator = _Allocator())
...@@ -593,6 +594,7 @@ namespace __debug ...@@ -593,6 +594,7 @@ namespace __debug
template<typename _Key, typename _Tp, typename _Compare = less<_Key>, template<typename _Key, typename _Tp, typename _Compare = less<_Key>,
typename _Allocator = allocator<pair<const _Key, _Tp>>, typename _Allocator = allocator<pair<const _Key, _Tp>>,
typename = _RequireNotAllocator<_Compare>,
typename = _RequireAllocator<_Allocator>> typename = _RequireAllocator<_Allocator>>
multimap(initializer_list<pair<_Key, _Tp>>, multimap(initializer_list<pair<_Key, _Tp>>,
_Compare = _Compare(), _Allocator = _Allocator()) _Compare = _Compare(), _Allocator = _Allocator())
......
...@@ -555,6 +555,7 @@ namespace __debug ...@@ -555,6 +555,7 @@ namespace __debug
typename _Allocator = typename _Allocator =
allocator<typename iterator_traits<_InputIterator>::value_type>, allocator<typename iterator_traits<_InputIterator>::value_type>,
typename = _RequireInputIter<_InputIterator>, typename = _RequireInputIter<_InputIterator>,
typename = _RequireNotAllocator<_Compare>,
typename = _RequireAllocator<_Allocator>> typename = _RequireAllocator<_Allocator>>
multiset(_InputIterator, _InputIterator, multiset(_InputIterator, _InputIterator,
_Compare = _Compare(), _Allocator = _Allocator()) _Compare = _Compare(), _Allocator = _Allocator())
...@@ -564,6 +565,7 @@ namespace __debug ...@@ -564,6 +565,7 @@ namespace __debug
template<typename _Key, template<typename _Key,
typename _Compare = less<_Key>, typename _Compare = less<_Key>,
typename _Allocator = allocator<_Key>, typename _Allocator = allocator<_Key>,
typename = _RequireNotAllocator<_Compare>,
typename = _RequireAllocator<_Allocator>> typename = _RequireAllocator<_Allocator>>
multiset(initializer_list<_Key>, multiset(initializer_list<_Key>,
_Compare = _Compare(), _Allocator = _Allocator()) _Compare = _Compare(), _Allocator = _Allocator())
......
...@@ -567,6 +567,7 @@ namespace __debug ...@@ -567,6 +567,7 @@ namespace __debug
typename _Allocator = typename _Allocator =
allocator<typename iterator_traits<_InputIterator>::value_type>, allocator<typename iterator_traits<_InputIterator>::value_type>,
typename = _RequireInputIter<_InputIterator>, typename = _RequireInputIter<_InputIterator>,
typename = _RequireNotAllocator<_Compare>,
typename = _RequireAllocator<_Allocator>> typename = _RequireAllocator<_Allocator>>
set(_InputIterator, _InputIterator, set(_InputIterator, _InputIterator,
_Compare = _Compare(), _Allocator = _Allocator()) _Compare = _Compare(), _Allocator = _Allocator())
...@@ -575,6 +576,7 @@ namespace __debug ...@@ -575,6 +576,7 @@ namespace __debug
template<typename _Key, typename _Compare = less<_Key>, template<typename _Key, typename _Compare = less<_Key>,
typename _Allocator = allocator<_Key>, typename _Allocator = allocator<_Key>,
typename = _RequireNotAllocator<_Compare>,
typename = _RequireAllocator<_Allocator>> typename = _RequireAllocator<_Allocator>>
set(initializer_list<_Key>, set(initializer_list<_Key>,
_Compare = _Compare(), _Allocator = _Allocator()) _Compare = _Compare(), _Allocator = _Allocator())
......
...@@ -651,6 +651,8 @@ namespace __debug ...@@ -651,6 +651,8 @@ namespace __debug
typename _Pred = equal_to<__iter_key_t<_InputIterator>>, typename _Pred = equal_to<__iter_key_t<_InputIterator>>,
typename _Allocator = allocator<__iter_to_alloc_t<_InputIterator>>, typename _Allocator = allocator<__iter_to_alloc_t<_InputIterator>>,
typename = _RequireInputIter<_InputIterator>, typename = _RequireInputIter<_InputIterator>,
typename = _RequireNotAllocatorOrIntegral<_Hash>,
typename = _RequireNotAllocator<_Pred>,
typename = _RequireAllocator<_Allocator>> typename = _RequireAllocator<_Allocator>>
unordered_map(_InputIterator, _InputIterator, unordered_map(_InputIterator, _InputIterator,
typename unordered_map<int, int>::size_type = {}, typename unordered_map<int, int>::size_type = {},
...@@ -662,6 +664,8 @@ namespace __debug ...@@ -662,6 +664,8 @@ namespace __debug
template<typename _Key, typename _Tp, typename _Hash = hash<_Key>, template<typename _Key, typename _Tp, typename _Hash = hash<_Key>,
typename _Pred = equal_to<_Key>, typename _Pred = equal_to<_Key>,
typename _Allocator = allocator<pair<const _Key, _Tp>>, typename _Allocator = allocator<pair<const _Key, _Tp>>,
typename = _RequireNotAllocatorOrIntegral<_Hash>,
typename = _RequireNotAllocator<_Pred>,
typename = _RequireAllocator<_Allocator>> typename = _RequireAllocator<_Allocator>>
unordered_map(initializer_list<pair<_Key, _Tp>>, unordered_map(initializer_list<pair<_Key, _Tp>>,
typename unordered_map<int, int>::size_type = {}, typename unordered_map<int, int>::size_type = {},
...@@ -691,6 +695,7 @@ namespace __debug ...@@ -691,6 +695,7 @@ namespace __debug
template<typename _InputIterator, typename _Hash, typename _Allocator, template<typename _InputIterator, typename _Hash, typename _Allocator,
typename = _RequireInputIter<_InputIterator>, typename = _RequireInputIter<_InputIterator>,
typename = _RequireNotAllocatorOrIntegral<_Hash>,
typename = _RequireAllocator<_Allocator>> typename = _RequireAllocator<_Allocator>>
unordered_map(_InputIterator, _InputIterator, unordered_map(_InputIterator, _InputIterator,
typename unordered_map<int, int>::size_type, typename unordered_map<int, int>::size_type,
...@@ -712,6 +717,7 @@ namespace __debug ...@@ -712,6 +717,7 @@ namespace __debug
-> unordered_map<_Key, _Tp, hash<_Key>, equal_to<_Key>, _Allocator>; -> unordered_map<_Key, _Tp, hash<_Key>, equal_to<_Key>, _Allocator>;
template<typename _Key, typename _Tp, typename _Hash, typename _Allocator, template<typename _Key, typename _Tp, typename _Hash, typename _Allocator,
typename = _RequireNotAllocatorOrIntegral<_Hash>,
typename = _RequireAllocator<_Allocator>> typename = _RequireAllocator<_Allocator>>
unordered_map(initializer_list<pair<_Key, _Tp>>, unordered_map(initializer_list<pair<_Key, _Tp>>,
typename unordered_map<int, int>::size_type, typename unordered_map<int, int>::size_type,
...@@ -752,7 +758,8 @@ namespace __debug ...@@ -752,7 +758,8 @@ namespace __debug
: public __gnu_debug::_Safe_container< : public __gnu_debug::_Safe_container<
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>, _Alloc, unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>, _Alloc,
__gnu_debug::_Safe_unordered_container>, __gnu_debug::_Safe_unordered_container>,
public _GLIBCXX_STD_C::unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc> public _GLIBCXX_STD_C::unordered_multimap<
_Key, _Tp, _Hash, _Pred, _Alloc>
{ {
typedef _GLIBCXX_STD_C::unordered_multimap<_Key, _Tp, _Hash, typedef _GLIBCXX_STD_C::unordered_multimap<_Key, _Tp, _Hash,
_Pred, _Alloc> _Base; _Pred, _Alloc> _Base;
...@@ -1250,6 +1257,8 @@ namespace __debug ...@@ -1250,6 +1257,8 @@ namespace __debug
typename _Pred = equal_to<__iter_key_t<_InputIterator>>, typename _Pred = equal_to<__iter_key_t<_InputIterator>>,
typename _Allocator = allocator<__iter_to_alloc_t<_InputIterator>>, typename _Allocator = allocator<__iter_to_alloc_t<_InputIterator>>,
typename = _RequireInputIter<_InputIterator>, typename = _RequireInputIter<_InputIterator>,
typename = _RequireNotAllocatorOrIntegral<_Hash>,
typename = _RequireNotAllocator<_Pred>,
typename = _RequireAllocator<_Allocator>> typename = _RequireAllocator<_Allocator>>
unordered_multimap(_InputIterator, _InputIterator, unordered_multimap(_InputIterator, _InputIterator,
unordered_multimap<int, int>::size_type = {}, unordered_multimap<int, int>::size_type = {},
...@@ -1262,6 +1271,8 @@ namespace __debug ...@@ -1262,6 +1271,8 @@ namespace __debug
template<typename _Key, typename _Tp, typename _Hash = hash<_Key>, template<typename _Key, typename _Tp, typename _Hash = hash<_Key>,
typename _Pred = equal_to<_Key>, typename _Pred = equal_to<_Key>,
typename _Allocator = allocator<pair<const _Key, _Tp>>, typename _Allocator = allocator<pair<const _Key, _Tp>>,
typename = _RequireNotAllocatorOrIntegral<_Hash>,
typename = _RequireNotAllocator<_Pred>,
typename = _RequireAllocator<_Allocator>> typename = _RequireAllocator<_Allocator>>
unordered_multimap(initializer_list<pair<_Key, _Tp>>, unordered_multimap(initializer_list<pair<_Key, _Tp>>,
unordered_multimap<int, int>::size_type = {}, unordered_multimap<int, int>::size_type = {},
...@@ -1290,6 +1301,7 @@ namespace __debug ...@@ -1290,6 +1301,7 @@ namespace __debug
template<typename _InputIterator, typename _Hash, typename _Allocator, template<typename _InputIterator, typename _Hash, typename _Allocator,
typename = _RequireInputIter<_InputIterator>, typename = _RequireInputIter<_InputIterator>,
typename = _RequireNotAllocatorOrIntegral<_Hash>,
typename = _RequireAllocator<_Allocator>> typename = _RequireAllocator<_Allocator>>
unordered_multimap(_InputIterator, _InputIterator, unordered_multimap(_InputIterator, _InputIterator,
unordered_multimap<int, int>::size_type, _Hash, unordered_multimap<int, int>::size_type, _Hash,
...@@ -1311,6 +1323,7 @@ namespace __debug ...@@ -1311,6 +1323,7 @@ namespace __debug
-> unordered_multimap<_Key, _Tp, hash<_Key>, equal_to<_Key>, _Allocator>; -> unordered_multimap<_Key, _Tp, hash<_Key>, equal_to<_Key>, _Allocator>;
template<typename _Key, typename _Tp, typename _Hash, typename _Allocator, template<typename _Key, typename _Tp, typename _Hash, typename _Allocator,
typename = _RequireNotAllocatorOrIntegral<_Hash>,
typename = _RequireAllocator<_Allocator>> typename = _RequireAllocator<_Allocator>>
unordered_multimap(initializer_list<pair<_Key, _Tp>>, unordered_multimap(initializer_list<pair<_Key, _Tp>>,
unordered_multimap<int, int>::size_type, unordered_multimap<int, int>::size_type,
......
...@@ -539,6 +539,8 @@ namespace __debug ...@@ -539,6 +539,8 @@ namespace __debug
typename _Allocator = typename _Allocator =
allocator<typename iterator_traits<_InputIterator>::value_type>, allocator<typename iterator_traits<_InputIterator>::value_type>,
typename = _RequireInputIter<_InputIterator>, typename = _RequireInputIter<_InputIterator>,
typename = _RequireNotAllocatorOrIntegral<_Hash>,
typename = _RequireNotAllocator<_Pred>,
typename = _RequireAllocator<_Allocator>> typename = _RequireAllocator<_Allocator>>
unordered_set(_InputIterator, _InputIterator, unordered_set(_InputIterator, _InputIterator,
unordered_set<int>::size_type = {}, unordered_set<int>::size_type = {},
...@@ -549,6 +551,8 @@ namespace __debug ...@@ -549,6 +551,8 @@ namespace __debug
template<typename _Tp, typename _Hash = hash<_Tp>, template<typename _Tp, typename _Hash = hash<_Tp>,
typename _Pred = equal_to<_Tp>, typename _Pred = equal_to<_Tp>,
typename _Allocator = allocator<_Tp>, typename _Allocator = allocator<_Tp>,
typename = _RequireNotAllocatorOrIntegral<_Hash>,
typename = _RequireNotAllocator<_Pred>,
typename = _RequireAllocator<_Allocator>> typename = _RequireAllocator<_Allocator>>
unordered_set(initializer_list<_Tp>, unordered_set(initializer_list<_Tp>,
unordered_set<int>::size_type = {}, unordered_set<int>::size_type = {},
...@@ -569,6 +573,7 @@ namespace __debug ...@@ -569,6 +573,7 @@ namespace __debug
template<typename _InputIterator, typename _Hash, typename _Allocator, template<typename _InputIterator, typename _Hash, typename _Allocator,
typename = _RequireInputIter<_InputIterator>, typename = _RequireInputIter<_InputIterator>,
typename = _RequireNotAllocatorOrIntegral<_Hash>,
typename = _RequireAllocator<_Allocator>> typename = _RequireAllocator<_Allocator>>
unordered_set(_InputIterator, _InputIterator, unordered_set(_InputIterator, _InputIterator,
unordered_set<int>::size_type, unordered_set<int>::size_type,
...@@ -586,6 +591,7 @@ namespace __debug ...@@ -586,6 +591,7 @@ namespace __debug
-> unordered_set<_Tp, hash<_Tp>, equal_to<_Tp>, _Allocator>; -> unordered_set<_Tp, hash<_Tp>, equal_to<_Tp>, _Allocator>;
template<typename _Tp, typename _Hash, typename _Allocator, template<typename _Tp, typename _Hash, typename _Allocator,
typename = _RequireNotAllocatorOrIntegral<_Hash>,
typename = _RequireAllocator<_Allocator>> typename = _RequireAllocator<_Allocator>>
unordered_set(initializer_list<_Tp>, unordered_set(initializer_list<_Tp>,
unordered_set<int>::size_type, _Hash, _Allocator) unordered_set<int>::size_type, _Hash, _Allocator)
...@@ -1093,6 +1099,8 @@ namespace __debug ...@@ -1093,6 +1099,8 @@ namespace __debug
typename _Allocator = typename _Allocator =
allocator<typename iterator_traits<_InputIterator>::value_type>, allocator<typename iterator_traits<_InputIterator>::value_type>,
typename = _RequireInputIter<_InputIterator>, typename = _RequireInputIter<_InputIterator>,
typename = _RequireNotAllocatorOrIntegral<_Hash>,
typename = _RequireNotAllocator<_Pred>,
typename = _RequireAllocator<_Allocator>> typename = _RequireAllocator<_Allocator>>
unordered_multiset(_InputIterator, _InputIterator, unordered_multiset(_InputIterator, _InputIterator,
unordered_multiset<int>::size_type = {}, unordered_multiset<int>::size_type = {},
...@@ -1104,6 +1112,8 @@ namespace __debug ...@@ -1104,6 +1112,8 @@ namespace __debug
template<typename _Tp, typename _Hash = hash<_Tp>, template<typename _Tp, typename _Hash = hash<_Tp>,
typename _Pred = equal_to<_Tp>, typename _Pred = equal_to<_Tp>,
typename _Allocator = allocator<_Tp>, typename _Allocator = allocator<_Tp>,
typename = _RequireNotAllocatorOrIntegral<_Hash>,
typename = _RequireNotAllocator<_Pred>,
typename = _RequireAllocator<_Allocator>> typename = _RequireAllocator<_Allocator>>
unordered_multiset(initializer_list<_Tp>, unordered_multiset(initializer_list<_Tp>,
unordered_multiset<int>::size_type = {}, unordered_multiset<int>::size_type = {},
...@@ -1125,6 +1135,7 @@ namespace __debug ...@@ -1125,6 +1135,7 @@ namespace __debug
template<typename _InputIterator, typename _Hash, typename _Allocator, template<typename _InputIterator, typename _Hash, typename _Allocator,
typename = _RequireInputIter<_InputIterator>, typename = _RequireInputIter<_InputIterator>,
typename = _RequireNotAllocatorOrIntegral<_Hash>,
typename = _RequireAllocator<_Allocator>> typename = _RequireAllocator<_Allocator>>
unordered_multiset(_InputIterator, _InputIterator, unordered_multiset(_InputIterator, _InputIterator,
unordered_multiset<int>::size_type, unordered_multiset<int>::size_type,
...@@ -1144,6 +1155,7 @@ namespace __debug ...@@ -1144,6 +1155,7 @@ namespace __debug
-> unordered_multiset<_Tp, hash<_Tp>, equal_to<_Tp>, _Allocator>; -> unordered_multiset<_Tp, hash<_Tp>, equal_to<_Tp>, _Allocator>;
template<typename _Tp, typename _Hash, typename _Allocator, template<typename _Tp, typename _Hash, typename _Allocator,
typename = _RequireNotAllocatorOrIntegral<_Hash>,
typename = _RequireAllocator<_Allocator>> typename = _RequireAllocator<_Allocator>>
unordered_multiset(initializer_list<_Tp>, unordered_multiset(initializer_list<_Tp>,
unordered_multiset<int>::size_type, _Hash, _Allocator) unordered_multiset<int>::size_type, _Hash, _Allocator)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment