// { dg-do compile { target c++17 } } #include struct S { }; // std::hash is a disabled specialization. template constexpr std::size_t hash_size = sizeof(std::hash>); template struct MultiHash : std::hash>... { }; #if _GLIBCXX_INLINE_VERSION // For the unstable ABI the size should always be one. template constexpr bool check_hash_size = sizeof(MultiHash) == 1; #else // For the default ABI, each std::hash> specialization has // a base class of type __hash_empty_base> and if // the same type occurs more than once they must have unique addresses. template constexpr bool check_hash_size = sizeof(MultiHash) == Size; #endif static_assert( check_hash_size<1, int> ); static_assert( check_hash_size<1, int, long, double> ); static_assert( check_hash_size<2, int, const int> ); static_assert( check_hash_size<2, int, long, const int> ); static_assert( check_hash_size<1, S> ); static_assert( check_hash_size<1, int, S> ); static_assert( check_hash_size<2, int, S, const int> ); static_assert( check_hash_size<2, int, S, const int, const S> ); static_assert( check_hash_size<2, int, S, const S, const int> );