[Bug libstdc++/91620] std::[forward_]list::remove_if/unique should respect to DR 526

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Aug 11 19:30:30 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91620

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Franथà¤ois Dumont
<fdumont@gcc.gnu.org>:

https://gcc.gnu.org/g:8b7af071b0cd4a6f8d989453ac81a4c3768d6343

commit r11-2658-g8b7af071b0cd4a6f8d989453ac81a4c3768d6343
Author: François Dumont <fdumont@gcc.gnu.org>
Date:   Sat Aug 8 22:22:00 2020 +0200

    libstdc++: Implement DR 526 on [forward_]list remove_if/unique [PR 91620]

    Respect DR 526 in implementation of std::[forward_]list
remove/remove_if/unique.
    [forward_]list::remove was already implementing it but the implementation
has
    been modified to generalize the following pattern. All nodes to remove are
    collected in an intermediate [forward_]list which purpose is just to be
    detroyed once out of scope.

    libstdc++-v3/ChangeLog:

            PR libstdc++/91620
            * include/bits/forward_list.tcc (forward_list<>::remove): Collect
nodes
            to destroy in an intermediate forward_list.
            (forward_list<>::remove_if, forward_list<>::unique): Likewise.
            * include/bits/list.tcc (list<>::remove, list<>::unique): Likewise.
            (list<>::remove_if): Likewise.
            * include/debug/forward_list (forward_list<>::_M_erase_after):
Remove.
            (forward_list<>::erase_after): Adapt.
            (forward_list<>::remove, forward_list<>::remove_if): Collect nodes
to
            destroy in an intermediate forward_list.
            (forward_list<>::unique): Likewise.
            * include/debug/list (list<>::remove, list<>::unique): Likewise.
            (list<>::remove_if): Likewise.
            * testsuite/23_containers/forward_list/operations/91620.cc: New
test.
            * testsuite/23_containers/list/operations/91620.cc: New test.


More information about the Gcc-bugs mailing list