https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117686
--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jonathan Wakely <r...@gcc.gnu.org>: https://gcc.gnu.org/g:4484945c538b26da6881f83f664235988e471d40 commit r15-5486-g4484945c538b26da6881f83f664235988e471d40 Author: Jonathan Wakely <jwak...@redhat.com> Date: Tue Nov 19 23:38:19 2024 +0000 libstdc++: Fix std::unordered_set::emplace optimization [PR117686] The __is_key_type specialization that matches a pair<key_type, T> argument is intended for std::unordered_map, not for std::unordered_set<std::pair<K,T>>. This uses a pair<const Args&...> as the template argument for __is_key_type, so that it won't match a set's key_type. libstdc++-v3/ChangeLog: PR libstdc++/117686 * include/bits/hashtable.h (_Hashtable::_M_emplace_uniq): Adjust usage of __is_key_type to avoid false positive. * testsuite/23_containers/unordered_set/insert/117686.cc: New test.