Skip to content
Snippets Groups Projects
Commit 46afbeb8 authored by François Dumont's avatar François Dumont
Browse files

libstdc++: [_GLIBCXX_DEBUG] Fix assignment of value-initialized iterator [PR112477]


Now that _M_Detach do not reset iterator _M_version value we need to reset it when
the iterator is attached to a new sequence, even if this sequencer is null when
assigning a value-initialized iterator. In this case _M_version shall be resetted to 0.

libstdc++-v3/ChangeLog:

	PR libstdc++/112477
	* src/c++11/debug.cc
	(_Safe_iterator_base::_M_attach): Reset _M_version to 0 if attaching to null
	sequence.
	(_Safe_iterator_base::_M_attach_single): Likewise.
	(_Safe_local_iterator_base::_M_attach): Likewise.
	(_Safe_local_iterator_base::_M_attach_single): Likewise.
	* testsuite/23_containers/map/debug/112477.cc: New test case.

Reviewed-by: default avatarJonathan Wakely <jwakely@redhat.com>
parent d2cb4693
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment