]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Inconsistent const in flat_map's value_type [PR122921]
authorPatrick Palka <ppalka@redhat.com>
Mon, 1 Dec 2025 22:08:01 +0000 (17:08 -0500)
committerPatrick Palka <ppalka@redhat.com>
Mon, 1 Dec 2025 22:08:01 +0000 (17:08 -0500)
commit3e02f86cd13c787331281ab098901f8a67381945
tree2a2b4d8cb4e05fdd181ade51f452a57da46c9ba9
parentd9a64bf6a6d8f6f7570d717364dc767bfb3d7b8c
libstdc++: Inconsistent const in flat_map's value_type [PR122921]

flat_map's value_type is pair<key_type, mapped_type>, which we correctly
define within the container but incorrectly within the iterator.

PR libstdc++/122921

libstdc++-v3/ChangeLog:

* include/std/flat_map (_Flat_map_impl::_Iterator::value_type):
Remove const from key_type to make consistent with the
container's value_type.
* testsuite/23_containers/flat_map/1.cc (test09): New test.
* testsuite/23_containers/flat_multimap/1.cc (test09): New test.

Reported-by: Vincent X
Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/include/std/flat_map
libstdc++-v3/testsuite/23_containers/flat_map/1.cc
libstdc++-v3/testsuite/23_containers/flat_multimap/1.cc