]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: [_GLIBCXX_DEBUG] Remove useless constructor checks
authorFrançois Dumont <fdumont@gcc.gnu.org>
Mon, 23 Jan 2023 05:26:34 +0000 (06:26 +0100)
committerFrançois Dumont <fdumont@gcc.gnu.org>
Mon, 23 Jan 2023 18:11:54 +0000 (19:11 +0100)
commitc3c6c307792026705fe0398f5ee399f7668fed1b
tree81e797b1dc81e7ef2f210242cc5f0b07e5fb65e9
parent47b269caf87904fd0112e8c9e96884dd0313ed15
libstdc++: [_GLIBCXX_DEBUG] Remove useless constructor checks

Creating a safe iterator from a normal iterator is done within the library where we
already know that it is done correctly. The rare situation where a user would use safe
iterators for his own purpose is non-Standard code so outside _GLIBCXX_DEBUG scope. For
those reasons the __msg_init_singular is useless and can be removed.

Additionally in the copy constructor used for post-increment and post-decrement operators
the __msg_init_copy_singular check can also be ommitted because of the preliminary
__msg_bad_incr and __msg_bad_decr checks.

libstdc++-v3/ChangeLog:

* include/debug/safe_iterator.h (_Safe_iterator<>::_Unchecked): New.
(_Safe_iterator(const _Safe_iterator&, _Unchecked)): New.
(_Safe_iterator::operator++(int)): Use latter.
(_Safe_iterator::operator--(int)): Likewise.
(_Safe_iterator(_Iterator, const _Safe_sequence_base*)): Remove !_M_insular()
check.
* include/debug/safe_local_iterator.h (_Safe_local_iterator<>::_Unchecked):
New.
(_Safe_local_iterator(const _Safe_local_iterator&, _Unchecked)): New.
(_Safe_local_iterator::operator++(int)): Use latter.
* src/c++11/debug.cc (_S_debug_messages): Add as comment the _Debug_msg_id
entry associated to the array entry.
libstdc++-v3/include/debug/safe_iterator.h
libstdc++-v3/include/debug/safe_local_iterator.h
libstdc++-v3/src/c++11/debug.cc