Add assertion to _Rb_tree::erase to check for end iterators
authorJonathan Wakely <jwakely@redhat.com>
Fri, 16 Dec 2016 18:13:09 +0000 (18:13 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Fri, 16 Dec 2016 18:13:09 +0000 (18:13 +0000)
commit36b88526410cfbf2fcbd0150dde6c1128ff466df
treead952f44408dcfb8fd78bb52459f06152bcae867
parent680153bd1eefcdd31809fedd9a937bff03853dcf
Add assertion to _Rb_tree::erase to check for end iterators

* include/bits/stl_tree.h (_Rb_tree::_M_erase_aux(const_iterator)):
Add assertion for undefined argument.
(_Rb_tree::_M_erase_aux(const_iterator, const_iterator)): Call
_M_erase_aux directly instead of through erase.
(_Rb_tree::_M_erase_aux(const Key&)): Likewise.
* testsuite/23_containers/map/modifiers/erase/end_neg.cc: New test.

From-SVN: r243757
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/stl_tree.h
libstdc++-v3/testsuite/23_containers/map/modifiers/erase/end_neg.cc [new file with mode: 0644]