[libcxx] r299744 - Revert "Allow a standard library to implement conditional noexcept for optional and unique_ptr hash functions."
Akira Hatanaka via cfe-commits
cfe-commits at lists.llvm.org
Thu Apr 6 22:55:29 PDT 2017
Author: ahatanak
Date: Fri Apr 7 00:55:28 2017
New Revision: 299744
URL: http://llvm.org/viewvc/llvm-project?rev=299744&view=rev
Log:
Revert "Allow a standard library to implement conditional noexcept for optional and unique_ptr hash functions."
This reverts commit r299734.
Modified:
libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.hash/hash_unique_ptr.pass.cpp
libcxx/trunk/test/std/utilities/optional/optional.hash/hash.pass.cpp
Modified: libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.hash/hash_unique_ptr.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.hash/hash_unique_ptr.pass.cpp?rev=299744&r1=299743&r2=299744&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.hash/hash_unique_ptr.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.hash/hash_unique_ptr.pass.cpp Fri Apr 7 00:55:28 2017
@@ -67,14 +67,10 @@ int main()
int* ptr = new int;
std::unique_ptr<int> p(ptr);
std::hash<std::unique_ptr<int> > f;
+ ASSERT_NOT_NOEXCEPT(f(p));
std::size_t h = f(p);
assert(h == std::hash<int*>()(ptr));
}
- {
- std::unique_ptr<int, PointerDeleter<int, 1>> pThrowingHash;
- std::hash<std::unique_ptr<int, PointerDeleter<int, 1>>> fThrowingHash;
- ASSERT_NOT_NOEXCEPT(fThrowingHash(pThrowingHash));
- }
#if TEST_STD_VER >= 11
{
test_enabled_with_deleter<int, Deleter<int>>();
Modified: libcxx/trunk/test/std/utilities/optional/optional.hash/hash.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/optional/optional.hash/hash.pass.cpp?rev=299744&r1=299743&r2=299744&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/optional/optional.hash/hash.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/optional/optional.hash/hash.pass.cpp Fri Apr 7 00:55:28 2017
@@ -38,14 +38,9 @@ int main()
std::hash<optional<double>>{}(optional<double>{});
{
- optional<B> opt;
- ASSERT_NOT_NOEXCEPT(std::hash<optional<B>>()(opt));
- ASSERT_NOT_NOEXCEPT(std::hash<optional<const B>>()(opt));
- }
-
- {
typedef int T;
optional<T> opt;
+ ASSERT_NOT_NOEXCEPT(std::hash<optional<T>>()(opt));
assert(std::hash<optional<T>>{}(opt) == nullopt_hash);
opt = 2;
assert(std::hash<optional<T>>{}(opt) == std::hash<T>{}(*opt));
@@ -53,6 +48,7 @@ int main()
{
typedef std::string T;
optional<T> opt;
+ ASSERT_NOT_NOEXCEPT(std::hash<optional<T>>()(opt));
assert(std::hash<optional<T>>{}(opt) == nullopt_hash);
opt = std::string("123");
assert(std::hash<optional<T>>{}(opt) == std::hash<T>{}(*opt));
@@ -60,6 +56,7 @@ int main()
{
typedef std::unique_ptr<int> T;
optional<T> opt;
+ ASSERT_NOT_NOEXCEPT(std::hash<optional<T>>()(opt));
assert(std::hash<optional<T>>{}(opt) == nullopt_hash);
opt = std::unique_ptr<int>(new int(3));
assert(std::hash<optional<T>>{}(opt) == std::hash<T>{}(*opt));
More information about the cfe-commits
mailing list