Commit 976160b9 by Jonathan Wakely Committed by Jonathan Wakely

Add assertions to extract(const_iterator) functions

	* include/bits/stl_map.h (map::extract(const_iterator)): Assert that
	iterator is not past-the-end.
	* include/bits/stl_multimap.h (multimap::extract(const_iterator)):
	Likewise.
	* include/bits/stl_multiset.h (multiset::extract(const_iterator)):
	Likewise.
	* include/bits/stl_set.h (set::extract(const_iterator)): Likewise.
	* include/bits/unordered_map.h (unordered_map::extract(const_iterator))
	(unordered_multimap::extract(const_iterator)): Likewise.
	* include/bits/unordered_set.h (unordered_set::extract(const_iterator))
	(unordered_multiset::extract(const_iterator)): Likewise.

From-SVN: r240487
parent a38814c0
2016-09-26 Jonathan Wakely <jwakely@redhat.com>
* include/bits/stl_map.h (map::extract(const_iterator)): Assert that
iterator is not past-the-end.
* include/bits/stl_multimap.h (multimap::extract(const_iterator)):
Likewise.
* include/bits/stl_multiset.h (multiset::extract(const_iterator)):
Likewise.
* include/bits/stl_set.h (set::extract(const_iterator)): Likewise.
* include/bits/unordered_map.h (unordered_map::extract(const_iterator))
(unordered_multimap::extract(const_iterator)): Likewise.
* include/bits/unordered_set.h (unordered_set::extract(const_iterator))
(unordered_multiset::extract(const_iterator)): Likewise.
2016-09-26 Ville Voutilainen <ville.voutilainen@gmail.com>
PR libstdc++/77717
......
......@@ -605,7 +605,10 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
/// Extract a node.
node_type
extract(const_iterator __pos)
{ return _M_t.extract(__pos); }
{
__glibcxx_assert(__pos != end());
return _M_t.extract(__pos);
}
/// Extract a node.
node_type
......
......@@ -606,7 +606,10 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
/// Extract a node.
node_type
extract(const_iterator __pos)
{ return _M_t.extract(__pos); }
{
__glibcxx_assert(__pos != end());
return _M_t.extract(__pos);
}
/// Extract a node.
node_type
......
......@@ -549,7 +549,10 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
/// Extract a node.
node_type
extract(const_iterator __pos)
{ return _M_t.extract(__pos); }
{
__glibcxx_assert(__pos != end());
return _M_t.extract(__pos);
}
/// Extract a node.
node_type
......
......@@ -565,7 +565,10 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
/// Extract a node.
node_type
extract(const_iterator __pos)
{ return _M_t.extract(__pos); }
{
__glibcxx_assert(__pos != end());
return _M_t.extract(__pos);
}
/// Extract a node.
node_type
......
......@@ -421,7 +421,10 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
/// Extract a node.
node_type
extract(const_iterator __pos)
{ return _M_h.extract(__pos); }
{
__glibcxx_assert(__pos != end());
return _M_h.extract(__pos);
}
/// Extract a node.
node_type
......@@ -1534,7 +1537,10 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
/// Extract a node.
node_type
extract(const_iterator __pos)
{ return _M_h.extract(__pos); }
{
__glibcxx_assert(__pos != end());
return _M_h.extract(__pos);
}
/// Extract a node.
node_type
......
......@@ -482,7 +482,10 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
/// Extract a node.
node_type
extract(const_iterator __pos)
{ return _M_h.extract(__pos); }
{
__glibcxx_assert(__pos != end());
return _M_h.extract(__pos);
}
/// Extract a node.
node_type
......@@ -1190,7 +1193,10 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
/// Extract a node.
node_type
extract(const_iterator __pos)
{ return _M_h.extract(__pos); }
{
__glibcxx_assert(__pos != end());
return _M_h.extract(__pos);
}
/// Extract a node.
node_type
......
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