diff options
author | Patrick Palka <ppalka@redhat.com> | 2025-05-29 10:11:57 -0400 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2025-06-01 10:41:20 -0400 |
commit | 48d6f5dbb0e412266ebb77def04ed378ca856029 (patch) | |
tree | 50a36679a1ccc615c39d3196f0985477cf116bbb /gcc/dwarf2ctf.cc | |
parent | 512a41fae40cec705ca45a47150524154af8ead2 (diff) | |
download | gcc-48d6f5dbb0e412266ebb77def04ed378ca856029.zip gcc-48d6f5dbb0e412266ebb77def04ed378ca856029.tar.gz gcc-48d6f5dbb0e412266ebb77def04ed378ca856029.tar.bz2 |
libstdc++: Fix tuple/pair confusion with std::erase_if(flat_map) [PR120465]
std::erase_if for flat_map/multimap is implemented via ranges::erase_if
over a zip_view of the keys and values, the value_type of which is a
tuple, but the given predicate needs to be called with a pair (flat_map's
value_type). So use a projection to convert the tuple into a suitable
pair.
PR libstdc++/120465
libstdc++-v3/ChangeLog:
* include/std/flat_map (_Flat_map_impl::_M_erase_if): Use a
projection with ranges::remove_if to pass a pair instead of
a tuple to the predicate.
* testsuite/23_containers/flat_map/1.cc (test07): Strengthen
to expect the argument passed to the predicate is a pair.
* testsuite/23_containers/flat_multimap/1.cc (test07): Likewise.
Co-authored-by: Jonathan Wakely <jwakely@redhat.com>
Reviewed-by: Tomasz KamiĆski <tkaminsk@redhat.com>
Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
(cherry picked from commit 589b27ec5769410e036df57645ff1eb7c765f692)
Diffstat (limited to 'gcc/dwarf2ctf.cc')
0 files changed, 0 insertions, 0 deletions