瀏覽代碼

Fix recent build errors

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292689 91177308-0d34-0410-b5e6-96231b3b80d8
Eric Fiselier 8 年之前
父節點
當前提交
17b6e14cdc

+ 5 - 2
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<pointer>();
 }
 
+namespace std {
+
 template <class T>
-struct std::hash<min_pointer<T, std::integral_constant<size_t, 1>>> {
-  size_t operator()(min_pointer<T, std::integral_constant<size_t, 1>> p) const {
+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 {
     if (!p) return 0;
     return std::hash<T*>{}(std::addressof(*p));
   }
 };
+}
 
 struct A {};
 

+ 2 - 0
test/std/utilities/type.index/type.index.synopsis/hash_type_index.pass.cpp

@@ -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::result_type, std::size_t>::value), "" );
   }
+#if TEST_STD_VER >= 11
   {
     test_hash_enabled_for_type<std::type_index>(std::type_index(typeid(int)));
   }
+#endif
 }

+ 1 - 1
test/support/poisoned_hash_helper.hpp

@@ -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> const&&)>(), "");
 
-  const Hash h;
+  const Hash h{};
   assert(h(key) == h(key));
 
 }