https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104945
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Yes this is definitely an issue I think: // Explicit specializations for integer types. #define _Cxx_hashtable_define_trivial_hash(_Tp) \ template<> \ struct hash<_Tp> : public __hash_base<size_t, _Tp> \ { \ size_t \ operator()(_Tp __val) const noexcept \ { return static_cast<size_t>(__val); } \ }; .... /// Explicit specialization for long long. _Cxx_hashtable_define_trivial_hash(long long) .... /// Explicit specialization for unsigned long long. _Cxx_hashtable_define_trivial_hash(unsigned long long) With no check on size of size_t vs long long.