summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/thread
diff options
context:
space:
mode:
authorMarshall Clow <mclow.lists@gmail.com>2016-11-14 19:58:05 +0000
committerMarshall Clow <mclow.lists@gmail.com>2016-11-14 19:58:05 +0000
commit065b3af096c7171de33e774d29c4b9f2fd22821a (patch)
tree86206ba32a8aad22da5dc68db7c51e050462179c /libcxx/test/std/thread
parentec2595d2e12cdce58a93e8cabf9c71a95a52d100 (diff)
downloadbcm5719-llvm-065b3af096c7171de33e774d29c4b9f2fd22821a.tar.gz
bcm5719-llvm-065b3af096c7171de33e774d29c4b9f2fd22821a.zip
Implement P0516: 'Clarify That shared_future’s Copy Operations have Wide Contracts' which was adopted last week in Issaquah
llvm-svn: 286877
Diffstat (limited to 'libcxx/test/std/thread')
-rw-r--r--libcxx/test/std/thread/futures/futures.shared_future/copy_assign.pass.cpp6
-rw-r--r--libcxx/test/std/thread/futures/futures.shared_future/copy_ctor.pass.cpp6
2 files changed, 12 insertions, 0 deletions
diff --git a/libcxx/test/std/thread/futures/futures.shared_future/copy_assign.pass.cpp b/libcxx/test/std/thread/futures/futures.shared_future/copy_assign.pass.cpp
index 3f9e945ddda..abb9928e88a 100644
--- a/libcxx/test/std/thread/futures/futures.shared_future/copy_assign.pass.cpp
+++ b/libcxx/test/std/thread/futures/futures.shared_future/copy_assign.pass.cpp
@@ -15,10 +15,13 @@
// class shared_future<R>
// shared_future& operator=(const shared_future& rhs);
+// noexcept in C++17
#include <future>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
{
@@ -27,6 +30,9 @@ int main()
std::shared_future<T> f0 = p.get_future();
std::shared_future<T> f;
f = f0;
+#if TEST_STD_VER > 14
+ static_assert(noexcept(f = f0), "" );
+#endif
assert(f0.valid());
assert(f.valid());
}
diff --git a/libcxx/test/std/thread/futures/futures.shared_future/copy_ctor.pass.cpp b/libcxx/test/std/thread/futures/futures.shared_future/copy_ctor.pass.cpp
index 1da08808db2..2b663313887 100644
--- a/libcxx/test/std/thread/futures/futures.shared_future/copy_ctor.pass.cpp
+++ b/libcxx/test/std/thread/futures/futures.shared_future/copy_ctor.pass.cpp
@@ -15,10 +15,13 @@
// class shared_future<R>
// shared_future(const shared_future& rhs);
+// noexcept in C++17
#include <future>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
{
@@ -26,6 +29,9 @@ int main()
std::promise<T> p;
std::shared_future<T> f0 = p.get_future();
std::shared_future<T> f = f0;
+#if TEST_STD_VER > 14
+ static_assert(noexcept(std::shared_future<T>{f0}), "" );
+#endif
assert(f0.valid());
assert(f.valid());
}
OpenPOWER on IntegriCloud