https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117686
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> --- This is the fix: --- a/libstdc++-v3/include/bits/hashtable.h +++ b/libstdc++-v3/include/bits/hashtable.h @@ -2287,7 +2287,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION else if constexpr (sizeof...(_Args) == 2) { pair<const _Args&...> __refs(__args...); - if constexpr (__is_key_type<pair<_Args...>>) + if constexpr (__is_key_type<pair<const _Args&...>>) { const auto& __key = _ExtractKey{}(__refs); __kp = std::__addressof(__key);