diff options
Diffstat (limited to 'libcxx/test/std')
| -rw-r--r-- | libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.hash/hash_unique_ptr.pass.cpp | 7 | ||||
| -rw-r--r-- | libcxx/test/std/utilities/type.index/type.index.synopsis/hash_type_index.pass.cpp | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.hash/hash_unique_ptr.pass.cpp b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.hash/hash_unique_ptr.pass.cpp index f989a017348..879ea405c75 100644 --- a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.hash/hash_unique_ptr.pass.cpp +++ b/libcxx/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 {}; diff --git a/libcxx/test/std/utilities/type.index/type.index.synopsis/hash_type_index.pass.cpp b/libcxx/test/std/utilities/type.index/type.index.synopsis/hash_type_index.pass.cpp index 0fe020bf3d4..9ab58ea6c3a 100644 --- a/libcxx/test/std/utilities/type.index/type.index.synopsis/hash_type_index.pass.cpp +++ b/libcxx/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 } |

