summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/utilities/memory
diff options
context:
space:
mode:
authorBilly Robert O'Neal III <bion@microsoft.com>2017-04-06 23:50:21 +0000
committerBilly Robert O'Neal III <bion@microsoft.com>2017-04-06 23:50:21 +0000
commiteaeeaaf375c8824f641c0f02ed90582be73fc6ac (patch)
tree8f1133ce180f8c27f6256d1e005388604a8c6261 /libcxx/test/std/utilities/memory
parent10169b6d0daa53b741a779909bfe241783aff22e (diff)
downloadbcm5719-llvm-eaeeaaf375c8824f641c0f02ed90582be73fc6ac.tar.gz
bcm5719-llvm-eaeeaaf375c8824f641c0f02ed90582be73fc6ac.zip
Allow a standard library to implement conditional noexcept for optional and unique_ptr hash functions.
These tests were unconditionally asserting that optional and unique_ptr declare throwing hashes, but MSVC++ implements conditional noexcept forwarding that of the underlying hash function. As a result we were failing these tests but there's nothing forbidding strengthening noexcept in that way. Changed the ASSERT_NOT_NOEXCEPT asserts to use types which themselves have non-noexcept hash functions. llvm-svn: 299734
Diffstat (limited to 'libcxx/test/std/utilities/memory')
-rw-r--r--libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.hash/hash_unique_ptr.pass.cpp6
1 files changed, 5 insertions, 1 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 b539e638036..0afc9f62303 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
@@ -67,10 +67,14 @@ 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>>();
OpenPOWER on IntegriCloud