On 12/4/25 11:58, Jonathan Wakely wrote:
On Thu, 4 Dec 2025 at 06:16, François Dumont <[email protected]> wrote:
std::erase and std::erase_if are broken for users directly referencing
__gnu_debug::deque in their code that is to say without activating the
_GLIBCXX_DEBUG mode. The iterators potentially invalidated by the erase
operations are not detected by the __gnu_debug::deque container and so
won't be reported as invalidated.
We need explicit std::erase and std::erase_if implementations for
std::__debug::deque which will work also when _GLIBCXX_DEBUG mode is
activated.
libstdc++-v3/ChangeLog:
* include/debug/deque
(std::erase_if<>(std::__debug::deque<>&, _Pred): New.
(std::erase<>(std::__debug::deque<>&, const _Up&): New.
* include/std/deque (std::erase_if(std::deque<>&, _Pred)):
Remove
_GLIBCXX_DEBUG code.
* testsuite/23_containers/deque/debug/erase.cc: New test case.
*
testsuite/23_containers/deque/debug/invalidation/erase.cc: New test case.
23_containers/deque tests run normal and _GLIBCXX_DEBUG under Linux x86_64.
PR https://forge.sourceware.org/gcc/gcc-TEST/pulls/128
Is PR CI state fine as proof of tests ?
The CI for this pull request only built an arm cross compiler, it
didn't run any tests yet. There is a check_gcc CI job which should
run, but it doesn't seem to have started yet.
The https://forge.sourceware.org/gcc/gcc-TEST/actions/runs/94/jobs/0/attempt/1
sanity checks failed, because the check_GNU_style.py script failed.
That should not check libstdc++ sources because we don't use GNU
style, so I've submitted a patch to fix the script.
This is why I did a PR for such a trivial patch. My 10 years old laptop
is definitely too old to run the full testsuite.
That's what the compile farm is very useful for:
https://gcc.gnu.org/wiki/CompileFarm
I did not thought I had access to this, I'll have a look.
Have you at least run the deque tests?
make check RUNTESTFLAGS="conformance.exp=23_containers/deque/*
--target_board=unix\{,-D_GLIBCXX_DEBUG\}"
Yes, I had run them, but did it again following latest changes on debug
containers.
Ok to commit ?
OK if the deque tests pass, thanks.
Done, thanks