From 065b3af096c7171de33e774d29c4b9f2fd22821a Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Mon, 14 Nov 2016 19:58:05 +0000 Subject: Implement P0516: 'Clarify That shared_future’s Copy Operations have Wide Contracts' which was adopted last week in Issaquah MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit llvm-svn: 286877 --- .../std/thread/futures/futures.shared_future/copy_assign.pass.cpp | 6 ++++++ .../std/thread/futures/futures.shared_future/copy_ctor.pass.cpp | 6 ++++++ 2 files changed, 12 insertions(+) (limited to 'libcxx/test/std') 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 // shared_future& operator=(const shared_future& rhs); +// noexcept in C++17 #include #include +#include "test_macros.h" + int main() { { @@ -27,6 +30,9 @@ int main() std::shared_future f0 = p.get_future(); std::shared_future 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 // shared_future(const shared_future& rhs); +// noexcept in C++17 #include #include +#include "test_macros.h" + int main() { { @@ -26,6 +29,9 @@ int main() std::promise p; std::shared_future f0 = p.get_future(); std::shared_future f = f0; +#if TEST_STD_VER > 14 + static_assert(noexcept(std::shared_future{f0}), "" ); +#endif assert(f0.valid()); assert(f.valid()); } -- cgit v1.2.3