diff --git a/libcxx/docs/Status/Cxx17Papers.csv b/libcxx/docs/Status/Cxx17Papers.csv index 1a9d3b08f3ec3..6bb29823d1b9b 100644 --- a/libcxx/docs/Status/Cxx17Papers.csv +++ b/libcxx/docs/Status/Cxx17Papers.csv @@ -84,7 +84,7 @@ "`P0508R0 `__","Wording for GB 58 - structured bindings for node_handles","2016-11 (Issaquah)","|Complete|","7","`#99944 `__","" "`P0509R1 `__","Updating ""Restrictions on exception handling""","2016-11 (Issaquah)","|Nothing To Do|","n/a","`#103676 `__","" "`P0510R0 `__","Disallowing references, incomplete types, arrays, and empty variants","2016-11 (Issaquah)","|Complete|","4","`#103677 `__","" -"`P0513R0 `__","Poisoning the Hash","2016-11 (Issaquah)","|Complete|","5","`#103678 `__","" +"`P0513R0 `__","Poisoning the Hash","2016-11 (Issaquah)","|Complete|","5","`#103678 `__","Implemented as a DR against C++11 since LLVM 22. MSVC STL does the same." "`P0516R0 `__","Clarify That shared_future's Copy Operations have Wide Contracts","2016-11 (Issaquah)","|Complete|","4","`#103679 `__","" "`P0517R0 `__","Make future_error Constructible","2016-11 (Issaquah)","|Complete|","4","`#103680 `__","" "`P0521R0 `__","Proposed Resolution for CA 14 (shared_ptr use_count/unique)","2016-11 (Issaquah)","|Complete|","18","`#103681 `__","" diff --git a/libcxx/include/__functional/hash.h b/libcxx/include/__functional/hash.h index 83bbf1b5e26c3..f74f25fa6e84b 100644 --- a/libcxx/include/__functional/hash.h +++ b/libcxx/include/__functional/hash.h @@ -433,13 +433,10 @@ struct __hash_impl : __scalar_hash { template struct hash : public __hash_impl<_Tp> {}; -#if _LIBCPP_STD_VER >= 17 - template <> struct hash : public __unary_function { _LIBCPP_HIDE_FROM_ABI size_t operator()(nullptr_t) const _NOEXCEPT { return 662607004ull; } }; -#endif #ifndef _LIBCPP_CXX03_LANG template @@ -452,18 +449,12 @@ template > using __has_enabled_hash _LIBCPP_NODEBUG = integral_constant::value && is_default_constructible<_Hash>::value >; -# if _LIBCPP_STD_VER >= 17 template using __enable_hash_helper_imp _LIBCPP_NODEBUG = _Type; template using __enable_hash_helper _LIBCPP_NODEBUG = __enable_hash_helper_imp<_Type, __enable_if_t<__all<__has_enabled_hash<_Keys>::value...>::value> >; -# else -template -using __enable_hash_helper _LIBCPP_NODEBUG = _Type; -# endif - #endif // !_LIBCPP_CXX03_LANG _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/test/std/utilities/function.objects/unord.hash/pointer.pass.cpp b/libcxx/test/std/utilities/function.objects/unord.hash/pointer.pass.cpp index 448c5ba143c10..ce331e59ffdb5 100644 --- a/libcxx/test/std/utilities/function.objects/unord.hash/pointer.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/unord.hash/pointer.pass.cpp @@ -17,6 +17,8 @@ // size_t operator()(T val) const; // }; +// XFAIL: FROZEN-CXX03-HEADERS-FIXME + // Not very portable #include @@ -44,18 +46,14 @@ test() assert(h(&i) != h(&j)); } -// can't hash nullptr_t until C++17 -void test_nullptr() -{ -#if TEST_STD_VER > 14 - typedef std::nullptr_t T; - typedef std::hash H; +void test_nullptr() { + typedef std::nullptr_t T; + typedef std::hash H; #if TEST_STD_VER <= 17 - static_assert((std::is_same::value), "" ); - static_assert((std::is_same::value), "" ); -#endif - ASSERT_NOEXCEPT(H()(T())); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); #endif + ASSERT_NOEXCEPT(H()(T())); } int main(int, char**) 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 32fc949354c69..e7540498b8de7 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 @@ -90,12 +90,10 @@ int main(int, char**) test_enabled_with_deleter>(); test_enabled_with_deleter>(); -#if TEST_STD_VER > 14 test_disabled_with_deleter>(); test_disabled_with_deleter>(); test_disabled_with_deleter>(); test_disabled_with_deleter>(); -#endif } #endif diff --git a/libcxx/test/support/poisoned_hash_helper.h b/libcxx/test/support/poisoned_hash_helper.h index 93b579d2dfde3..cd71cd70d6a84 100644 --- a/libcxx/test/support/poisoned_hash_helper.h +++ b/libcxx/test/support/poisoned_hash_helper.h @@ -123,13 +123,9 @@ struct Class {}; // Each header that declares the std::hash template provides enabled // specializations of std::hash for std::nullptr_t and all cv-unqualified // arithmetic, enumeration, and pointer types. -#if TEST_STD_VER >= 17 -using MaybeNullptr = types::type_list; -#else -using MaybeNullptr = types::type_list<>; -#endif -using LibraryHashTypes = types:: - concatenate_t, MaybeNullptr>; +using LibraryHashTypes = + types::concatenate_t>; struct TestHashEnabled { template