01b1afdc35
An attach iterator has its _M_version set to something != 0, the container version. This value shall be preserved when detaching it so that the iterator does not look like a value-initialized one. libstdc++-v3/ChangeLog: * include/debug/formatter.h (__singular_value_init): New _Iterator_state enum entry. (_Parameter<>(const _Safe_iterator<>&, const char*, _Is_iterator)): Check if iterator parameter is value-initialized. (_Parameter<>(const _Safe_local_iterator<>&, const char*, _Is_iterator)): Likewise. * include/debug/safe_iterator.h (_Safe_iterator<>::_M_value_initialized()): New. Adapt checks. * include/debug/safe_local_iterator.h (_Safe_local_iterator<>::_M_value_initialized()): New. Adapt checks. * src/c++11/debug.cc (_Safe_iterator_base::_M_reset): Do not reset _M_version. (print_field(PrintContext&, const _Parameter&, const char*)): Adapt state_names. * testsuite/23_containers/deque/debug/iterator1_neg.cc: New test. * testsuite/23_containers/deque/debug/iterator2_neg.cc: New test. * testsuite/23_containers/forward_list/debug/iterator1_neg.cc: New test. * testsuite/23_containers/forward_list/debug/iterator2_neg.cc: New test. * testsuite/23_containers/forward_list/debug/iterator3_neg.cc: New test. |
||
---|---|---|
.. | ||
array | ||
assertions.h | ||
bitset | ||
debug.h | ||
deque | ||
formatter.h | ||
forward_list | ||
functions.h | ||
helper_functions.h | ||
list | ||
macros.h | ||
map | ||
map.h | ||
multimap.h | ||
multiset.h | ||
safe_base.h | ||
safe_container.h | ||
safe_iterator.h | ||
safe_iterator.tcc | ||
safe_local_iterator.h | ||
safe_local_iterator.tcc | ||
safe_sequence.h | ||
safe_sequence.tcc | ||
safe_unordered_base.h | ||
safe_unordered_container.h | ||
safe_unordered_container.tcc | ||
set | ||
set.h | ||
stl_iterator.h | ||
string | ||
unordered_map | ||
unordered_set | ||
vector |