[Bug libstdc++/125374] std::flat_map unconditionally moves from lvalue keys in _M_try_emplace
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu May 21 14:38:08 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125374
--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-16 branch has been updated by Patrick Palka
<ppalka@gcc.gnu.org>:
https://gcc.gnu.org/g:f7e3e2881412f1f80bdeb8303ab20fc8f84dda3e
commit r16-8949-gf7e3e2881412f1f80bdeb8303ab20fc8f84dda3e
Author: Patrick Palka <ppalka@redhat.com>
Date: Tue May 19 13:43:10 2026 -0400
libstdc++: Fix incorrect move in flat_map::_M_try_emplace [PR125374]
PR libstdc++/125374
libstdc++-v3/ChangeLog:
* include/std/flat_map (_Flat_map_impl::_M_try_emplace): Forward
instead of unconditionally moving __k when inserting it.
* testsuite/23_containers/flat_map/1.cc (test10): New test.
Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
(cherry picked from commit 6d114645fa1c9831a109c8a8934685f49364818a)
More information about the Gcc-bugs
mailing list