mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-23 01:18:52 +08:00
Fix recent build errors
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292689 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -46,13 +46,16 @@ void test_disabled_with_deleter() {
|
|||||||
test_hash_disabled_for_type<pointer>();
|
test_hash_disabled_for_type<pointer>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace std {
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
struct std::hash<min_pointer<T, std::integral_constant<size_t, 1>>> {
|
struct hash<::min_pointer<T, std::integral_constant<size_t, 1>>> {
|
||||||
size_t operator()(min_pointer<T, std::integral_constant<size_t, 1>> p) const {
|
size_t operator()(::min_pointer<T, std::integral_constant<size_t, 1>> p) const {
|
||||||
if (!p) return 0;
|
if (!p) return 0;
|
||||||
return std::hash<T*>{}(std::addressof(*p));
|
return std::hash<T*>{}(std::addressof(*p));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
struct A {};
|
struct A {};
|
||||||
|
|
||||||
|
@@ -30,7 +30,9 @@ int main()
|
|||||||
static_assert((std::is_same<typename H::argument_type, std::type_index>::value), "" );
|
static_assert((std::is_same<typename H::argument_type, std::type_index>::value), "" );
|
||||||
static_assert((std::is_same<typename H::result_type, std::size_t>::value), "" );
|
static_assert((std::is_same<typename H::result_type, std::size_t>::value), "" );
|
||||||
}
|
}
|
||||||
|
#if TEST_STD_VER >= 11
|
||||||
{
|
{
|
||||||
test_hash_enabled_for_type<std::type_index>(std::type_index(typeid(int)));
|
test_hash_enabled_for_type<std::type_index>(std::type_index(typeid(int)));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
@@ -163,7 +163,7 @@ void test_hash_enabled(InputKey const& key) {
|
|||||||
static_assert(can_hash<Hash(ConvertibleTo<Key> &&)>(), "");
|
static_assert(can_hash<Hash(ConvertibleTo<Key> &&)>(), "");
|
||||||
static_assert(can_hash<Hash(ConvertibleTo<Key> const&&)>(), "");
|
static_assert(can_hash<Hash(ConvertibleTo<Key> const&&)>(), "");
|
||||||
|
|
||||||
const Hash h;
|
const Hash h{};
|
||||||
assert(h(key) == h(key));
|
assert(h(key) == h(key));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user