From 17b6e14cdce39f56c38a643cfa39c1d25fc092e3 Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Sat, 21 Jan 2017 00:57:29 +0000 Subject: [PATCH] Fix recent build errors git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292689 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../util.smartptr.hash/hash_unique_ptr.pass.cpp | 7 +++++-- .../type.index.synopsis/hash_type_index.pass.cpp | 2 ++ test/support/poisoned_hash_helper.hpp | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/test/std/utilities/memory/util.smartptr/util.smartptr.hash/hash_unique_ptr.pass.cpp b/test/std/utilities/memory/util.smartptr/util.smartptr.hash/hash_unique_ptr.pass.cpp index f989a0173..879ea405c 100644 --- a/test/std/utilities/memory/util.smartptr/util.smartptr.hash/hash_unique_ptr.pass.cpp +++ b/test/std/utilities/memory/util.smartptr/util.smartptr.hash/hash_unique_ptr.pass.cpp @@ -46,13 +46,16 @@ void test_disabled_with_deleter() { test_hash_disabled_for_type(); } +namespace std { + template -struct std::hash>> { - size_t operator()(min_pointer> p) const { +struct hash<::min_pointer>> { + size_t operator()(::min_pointer> p) const { if (!p) return 0; return std::hash{}(std::addressof(*p)); } }; +} struct A {}; diff --git a/test/std/utilities/type.index/type.index.synopsis/hash_type_index.pass.cpp b/test/std/utilities/type.index/type.index.synopsis/hash_type_index.pass.cpp index 0fe020bf3..9ab58ea6c 100644 --- a/test/std/utilities/type.index/type.index.synopsis/hash_type_index.pass.cpp +++ b/test/std/utilities/type.index/type.index.synopsis/hash_type_index.pass.cpp @@ -30,7 +30,9 @@ int main() static_assert((std::is_same::value), "" ); static_assert((std::is_same::value), "" ); } +#if TEST_STD_VER >= 11 { test_hash_enabled_for_type(std::type_index(typeid(int))); } +#endif } diff --git a/test/support/poisoned_hash_helper.hpp b/test/support/poisoned_hash_helper.hpp index 0a5675a2c..e8a2d8c3a 100644 --- a/test/support/poisoned_hash_helper.hpp +++ b/test/support/poisoned_hash_helper.hpp @@ -163,7 +163,7 @@ void test_hash_enabled(InputKey const& key) { static_assert(can_hash &&)>(), ""); static_assert(can_hash const&&)>(), ""); - const Hash h; + const Hash h{}; assert(h(key) == h(key)); }