Files
gcc/libstdc++-v3/include/debug
François Dumont e166a0f5ee libstdc++: [_GLIBCXX_DEBUG] Fix std::erase_if behavior for __gnu_debug::vector
When using directly __gnu_debug::vector the std::erase_if is called with a
reference to the std::vector base class and so is missing the invalidation
of the iterators implied by this operation.

To fix this provide a std::erase_if overload dedicated to __gnu_debug::vector.
Doing so we can cleanup the implementation dedicated to std::vector from any
_GLIBCXX_DEBUG consideration.

libstdc++-v3/ChangeLog:

	* include/debug/vector (std::erase_if, std::erase): New overloads for
	std::__debug::vector instances.
	* include/std/vector (std::erase_if, std::erase): Make overloads specific
	to normal std::vector implementation.
	* testsuite/23_containers/vector/debug/erase.cc: New test case.
	* testsuite/23_containers/vector/debug/invalidation/erase.cc: New test case.
2025-11-20 19:10:20 +01:00
..