diff options
Diffstat (limited to 'test/std/thread')
33 files changed, 209 insertions, 166 deletions
diff --git a/test/std/thread/futures/futures.async/async.fail.cpp b/test/std/thread/futures/futures.async/async.fail.cpp new file mode 100644 index 0000000000000..594c67f526992 --- /dev/null +++ b/test/std/thread/futures/futures.async/async.fail.cpp @@ -0,0 +1,38 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// UNSUPPORTED: libcpp-has-no-threads +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 +// UNSUPPORTED: clang-3.3, clang-3.4, clang-3.5, clang-3.6, clang-3.7, clang-3.8 + +// <future> + +// template <class F, class... Args> +// future<typename result_of<F(Args...)>::type> +// async(F&& f, Args&&... args); + +// template <class F, class... Args> +// future<typename result_of<F(Args...)>::type> +// async(launch policy, F&& f, Args&&... args); + + +#include <future> +#include <atomic> +#include <memory> +#include <cassert> + +#include "test_macros.h" + +int foo (int x) { return x; } + +int main () +{ + std::async( foo, 3); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}} + std::async(std::launch::async, foo, 3); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}} +}
\ No newline at end of file diff --git a/test/std/thread/futures/futures.async/async_race.pass.cpp b/test/std/thread/futures/futures.async/async_race.pass.cpp index 9acdd1abc4857..1189f3550b72e 100644 --- a/test/std/thread/futures/futures.async/async_race.pass.cpp +++ b/test/std/thread/futures/futures.async/async_race.pass.cpp @@ -21,7 +21,7 @@ // async(launch policy, F&& f, Args&&... args); // This test is designed to cause and allow TSAN to detect the race condition -// reported in PR23293. (http://llvm.org/PR23293). +// reported in PR23293: https://bugs.llvm.org/show_bug.cgi?id=23293 #include <future> #include <chrono> diff --git a/test/std/thread/futures/futures.shared_future/wait_until.pass.cpp b/test/std/thread/futures/futures.shared_future/wait_until.pass.cpp index 9cdc2e431f450..0ddbd0b08936d 100644 --- a/test/std/thread/futures/futures.shared_future/wait_until.pass.cpp +++ b/test/std/thread/futures/futures.shared_future/wait_until.pass.cpp @@ -1,130 +1,130 @@ - //===----------------------------------------------------------------------===// - // - // The LLVM Compiler Infrastructure - // - // This file is dual licensed under the MIT and the University of Illinois Open - // Source Licenses. See LICENSE.TXT for details. - // - //===----------------------------------------------------------------------===// - // - // UNSUPPORTED: libcpp-has-no-threads - // UNSUPPORTED: c++98, c++03 +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// UNSUPPORTED: libcpp-has-no-threads +// UNSUPPORTED: c++98, c++03 - // <future> +// <future> - // class shared_future<R> +// class shared_future<R> - // template <class Clock, class Duration> - // future_status - // wait_until(const chrono::time_point<Clock, Duration>& abs_time) const; +// template <class Clock, class Duration> +// future_status +// wait_until(const chrono::time_point<Clock, Duration>& abs_time) const; - #include <future> - #include <atomic> - #include <cassert> +#include <future> +#include <atomic> +#include <cassert> - enum class WorkerThreadState { Uninitialized, AllowedToRun, Exiting }; - typedef std::chrono::milliseconds ms; +enum class WorkerThreadState { Uninitialized, AllowedToRun, Exiting }; +typedef std::chrono::milliseconds ms; - std::atomic<WorkerThreadState> thread_state(WorkerThreadState::Uninitialized); +std::atomic<WorkerThreadState> thread_state(WorkerThreadState::Uninitialized); - void set_worker_thread_state(WorkerThreadState state) - { - thread_state.store(state, std::memory_order_relaxed); - } +void set_worker_thread_state(WorkerThreadState state) +{ + thread_state.store(state, std::memory_order_relaxed); +} - void wait_for_worker_thread_state(WorkerThreadState state) - { - while (thread_state.load(std::memory_order_relaxed) != state); - } +void wait_for_worker_thread_state(WorkerThreadState state) +{ + while (thread_state.load(std::memory_order_relaxed) != state); +} - void func1(std::promise<int> p) - { - wait_for_worker_thread_state(WorkerThreadState::AllowedToRun); - p.set_value(3); - set_worker_thread_state(WorkerThreadState::Exiting); - } +void func1(std::promise<int> p) +{ + wait_for_worker_thread_state(WorkerThreadState::AllowedToRun); + p.set_value(3); + set_worker_thread_state(WorkerThreadState::Exiting); +} - int j = 0; +int j = 0; - void func3(std::promise<int&> p) - { - wait_for_worker_thread_state(WorkerThreadState::AllowedToRun); - j = 5; - p.set_value(j); - set_worker_thread_state(WorkerThreadState::Exiting); - } +void func3(std::promise<int&> p) +{ + wait_for_worker_thread_state(WorkerThreadState::AllowedToRun); + j = 5; + p.set_value(j); + set_worker_thread_state(WorkerThreadState::Exiting); +} - void func5(std::promise<void> p) - { - wait_for_worker_thread_state(WorkerThreadState::AllowedToRun); - p.set_value(); - set_worker_thread_state(WorkerThreadState::Exiting); - } +void func5(std::promise<void> p) +{ + wait_for_worker_thread_state(WorkerThreadState::AllowedToRun); + p.set_value(); + set_worker_thread_state(WorkerThreadState::Exiting); +} - int main() - { - typedef std::chrono::high_resolution_clock Clock; - { - typedef int T; - std::promise<T> p; - std::shared_future<T> f = p.get_future(); - std::thread(func1, std::move(p)).detach(); - assert(f.valid()); - assert(f.wait_until(Clock::now() + ms(10)) == std::future_status::timeout); - assert(f.valid()); +int main() +{ + typedef std::chrono::high_resolution_clock Clock; + { + typedef int T; + std::promise<T> p; + std::shared_future<T> f = p.get_future(); + std::thread(func1, std::move(p)).detach(); + assert(f.valid()); + assert(f.wait_until(Clock::now() + ms(10)) == std::future_status::timeout); + assert(f.valid()); - // allow the worker thread to produce the result and wait until the worker is done - set_worker_thread_state(WorkerThreadState::AllowedToRun); - wait_for_worker_thread_state(WorkerThreadState::Exiting); + // allow the worker thread to produce the result and wait until the worker is done + set_worker_thread_state(WorkerThreadState::AllowedToRun); + wait_for_worker_thread_state(WorkerThreadState::Exiting); - assert(f.wait_until(Clock::now() + ms(10)) == std::future_status::ready); - assert(f.valid()); - Clock::time_point t0 = Clock::now(); - f.wait(); - Clock::time_point t1 = Clock::now(); - assert(f.valid()); - assert(t1-t0 < ms(5)); - } - { - typedef int& T; - std::promise<T> p; - std::shared_future<T> f = p.get_future(); - std::thread(func3, std::move(p)).detach(); - assert(f.valid()); - assert(f.wait_until(Clock::now() + ms(10)) == std::future_status::timeout); - assert(f.valid()); + assert(f.wait_until(Clock::now() + ms(10)) == std::future_status::ready); + assert(f.valid()); + Clock::time_point t0 = Clock::now(); + f.wait(); + Clock::time_point t1 = Clock::now(); + assert(f.valid()); + assert(t1-t0 < ms(5)); + } + { + typedef int& T; + std::promise<T> p; + std::shared_future<T> f = p.get_future(); + std::thread(func3, std::move(p)).detach(); + assert(f.valid()); + assert(f.wait_until(Clock::now() + ms(10)) == std::future_status::timeout); + assert(f.valid()); - // allow the worker thread to produce the result and wait until the worker is done - set_worker_thread_state(WorkerThreadState::AllowedToRun); - wait_for_worker_thread_state(WorkerThreadState::Exiting); + // allow the worker thread to produce the result and wait until the worker is done + set_worker_thread_state(WorkerThreadState::AllowedToRun); + wait_for_worker_thread_state(WorkerThreadState::Exiting); - assert(f.wait_until(Clock::now() + ms(10)) == std::future_status::ready); - assert(f.valid()); - Clock::time_point t0 = Clock::now(); - f.wait(); - Clock::time_point t1 = Clock::now(); - assert(f.valid()); - assert(t1-t0 < ms(5)); - } - { - typedef void T; - std::promise<T> p; - std::shared_future<T> f = p.get_future(); - std::thread(func5, std::move(p)).detach(); - assert(f.valid()); - assert(f.wait_until(Clock::now() + ms(10)) == std::future_status::timeout); - assert(f.valid()); + assert(f.wait_until(Clock::now() + ms(10)) == std::future_status::ready); + assert(f.valid()); + Clock::time_point t0 = Clock::now(); + f.wait(); + Clock::time_point t1 = Clock::now(); + assert(f.valid()); + assert(t1-t0 < ms(5)); + } + { + typedef void T; + std::promise<T> p; + std::shared_future<T> f = p.get_future(); + std::thread(func5, std::move(p)).detach(); + assert(f.valid()); + assert(f.wait_until(Clock::now() + ms(10)) == std::future_status::timeout); + assert(f.valid()); - // allow the worker thread to produce the result and wait until the worker is done - set_worker_thread_state(WorkerThreadState::AllowedToRun); - wait_for_worker_thread_state(WorkerThreadState::Exiting); + // allow the worker thread to produce the result and wait until the worker is done + set_worker_thread_state(WorkerThreadState::AllowedToRun); + wait_for_worker_thread_state(WorkerThreadState::Exiting); - assert(f.wait_until(Clock::now() + ms(10)) == std::future_status::ready); - assert(f.valid()); - Clock::time_point t0 = Clock::now(); - f.wait(); - Clock::time_point t1 = Clock::now(); - assert(f.valid()); - assert(t1-t0 < ms(5)); - } - } + assert(f.wait_until(Clock::now() + ms(10)) == std::future_status::ready); + assert(f.valid()); + Clock::time_point t0 = Clock::now(); + f.wait(); + Clock::time_point t1 = Clock::now(); + assert(f.valid()); + assert(t1-t0 < ms(5)); + } +} diff --git a/test/std/thread/futures/futures.task/futures.task.members/ctor_func_alloc.pass.cpp b/test/std/thread/futures/futures.task/futures.task.members/ctor_func_alloc.pass.cpp index 7cac21d48aefa..14b29715ef4f2 100644 --- a/test/std/thread/futures/futures.task/futures.task.members/ctor_func_alloc.pass.cpp +++ b/test/std/thread/futures/futures.task/futures.task.members/ctor_func_alloc.pass.cpp @@ -9,6 +9,8 @@ // // UNSUPPORTED: libcpp-has-no-threads // UNSUPPORTED: c++98, c++03 +// REQUIRES: c++11 || c++14 +// packaged_task allocator support was removed in C++17 (LWG 2921) // <future> diff --git a/test/std/thread/futures/futures.task/futures.task.nonmembers/uses_allocator.pass.cpp b/test/std/thread/futures/futures.task/futures.task.nonmembers/uses_allocator.pass.cpp index bbe75de7f8a9c..31ed57e221fc3 100644 --- a/test/std/thread/futures/futures.task/futures.task.nonmembers/uses_allocator.pass.cpp +++ b/test/std/thread/futures/futures.task/futures.task.nonmembers/uses_allocator.pass.cpp @@ -16,6 +16,8 @@ // XFAIL: c++98, c++03 // <future> +// REQUIRES: c++11 || c++14 +// packaged_task allocator support was removed in C++17 (LWG 2976) // class packaged_task<R(ArgTypes...)> diff --git a/test/std/thread/thread.mutex/thread.lock.algorithm/try_lock.pass.cpp b/test/std/thread/thread.mutex/thread.lock.algorithm/try_lock.pass.cpp index 4ad7a3ac28531..0f5f5591f9181 100644 --- a/test/std/thread/thread.mutex/thread.lock.algorithm/try_lock.pass.cpp +++ b/test/std/thread/thread.mutex/thread.lock.algorithm/try_lock.pass.cpp @@ -102,7 +102,7 @@ int main() L2 l1; try { - std::try_lock(l0, l1); + (void)std::try_lock(l0, l1); assert(false); } catch (int) @@ -116,7 +116,7 @@ int main() L0 l1; try { - std::try_lock(l0, l1); + (void)std::try_lock(l0, l1); assert(false); } catch (int) @@ -152,7 +152,7 @@ int main() L2 l2; try { - std::try_lock(l0, l1, l2); + (void)std::try_lock(l0, l1, l2); assert(false); } catch (int) @@ -206,7 +206,7 @@ int main() L2 l2; try { - std::try_lock(l0, l1, l2); + (void)std::try_lock(l0, l1, l2); assert(false); } catch (int) @@ -222,7 +222,7 @@ int main() L0 l2; try { - std::try_lock(l0, l1, l2); + (void)std::try_lock(l0, l1, l2); assert(false); } catch (int) @@ -238,7 +238,7 @@ int main() L0 l2; try { - std::try_lock(l0, l1, l2); + (void)std::try_lock(l0, l1, l2); assert(false); } catch (int) @@ -301,7 +301,7 @@ int main() L1 l2; try { - std::try_lock(l0, l1, l2); + (void)std::try_lock(l0, l1, l2); assert(false); } catch (int) @@ -317,7 +317,7 @@ int main() L0 l2; try { - std::try_lock(l0, l1, l2); + (void)std::try_lock(l0, l1, l2); assert(false); } catch (int) @@ -333,7 +333,7 @@ int main() L2 l2; try { - std::try_lock(l0, l1, l2); + (void)std::try_lock(l0, l1, l2); assert(false); } catch (int) @@ -349,7 +349,7 @@ int main() L2 l2; try { - std::try_lock(l0, l1, l2); + (void)std::try_lock(l0, l1, l2); assert(false); } catch (int) @@ -365,7 +365,7 @@ int main() L1 l2; try { - std::try_lock(l0, l1, l2); + (void)std::try_lock(l0, l1, l2); assert(false); } catch (int) @@ -381,7 +381,7 @@ int main() L2 l2; try { - std::try_lock(l0, l1, l2); + (void)std::try_lock(l0, l1, l2); assert(false); } catch (int) @@ -406,7 +406,7 @@ int main() L1 l2; try { - std::try_lock(l0, l1, l2); + (void)std::try_lock(l0, l1, l2); assert(false); } catch (int) @@ -440,7 +440,7 @@ int main() L1 l2; try { - std::try_lock(l0, l1, l2); + (void)std::try_lock(l0, l1, l2); assert(false); } catch (int) @@ -456,7 +456,7 @@ int main() L0 l2; try { - std::try_lock(l0, l1, l2); + (void)std::try_lock(l0, l1, l2); assert(false); } catch (int) diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/move_assign.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/move_assign.pass.cpp index bd707bb90ce10..ee36e84c0a506 100644 --- a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/move_assign.pass.cpp +++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/move_assign.pass.cpp @@ -25,8 +25,8 @@ int main() { { typedef std::shared_timed_mutex M; - M m0; - M m1; + M m0; + M m1; std::shared_lock<M> lk0(m0); std::shared_lock<M> lk1(m1); lk1 = std::move(lk0); @@ -37,8 +37,8 @@ int main() } { typedef nasty_mutex M; - M m0; - M m1; + M m0; + M m1; std::shared_lock<M> lk0(m0); std::shared_lock<M> lk1(m1); lk1 = std::move(lk0); diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock.pass.cpp index 947b1ad012ecf..06dc11742ffbc 100644 --- a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock.pass.cpp +++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock.pass.cpp @@ -44,7 +44,7 @@ int main() #ifndef TEST_HAS_NO_EXCEPTIONS try { - lk.try_lock(); + TEST_IGNORE_NODISCARD lk.try_lock(); assert(false); } catch (std::system_error& e) @@ -60,7 +60,7 @@ int main() #ifndef TEST_HAS_NO_EXCEPTIONS try { - lk.try_lock(); + TEST_IGNORE_NODISCARD lk.try_lock(); assert(false); } catch (std::system_error& e) diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_for.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_for.pass.cpp index 5cb8054125632..7feb7139072fe 100644 --- a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_for.pass.cpp +++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_for.pass.cpp @@ -49,7 +49,7 @@ int main() #ifndef TEST_HAS_NO_EXCEPTIONS try { - lk.try_lock_for(ms(5)); + TEST_IGNORE_NODISCARD lk.try_lock_for(ms(5)); assert(false); } catch (std::system_error& e) @@ -65,7 +65,7 @@ int main() #ifndef TEST_HAS_NO_EXCEPTIONS try { - lk.try_lock_for(ms(5)); + TEST_IGNORE_NODISCARD lk.try_lock_for(ms(5)); assert(false); } catch (std::system_error& e) diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_until.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_until.pass.cpp index 3ba4128d719c6..836a9ae50b6db 100644 --- a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_until.pass.cpp +++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_until.pass.cpp @@ -49,7 +49,7 @@ int main() #ifndef TEST_HAS_NO_EXCEPTIONS try { - lk.try_lock_until(Clock::now()); + TEST_IGNORE_NODISCARD lk.try_lock_until(Clock::now()); assert(false); } catch (std::system_error& e) @@ -65,7 +65,7 @@ int main() #ifndef TEST_HAS_NO_EXCEPTIONS try { - lk.try_lock_until(Clock::now()); + TEST_IGNORE_NODISCARD lk.try_lock_until(Clock::now()); assert(false); } catch (std::system_error& e) diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/copy_assign.fail.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/copy_assign.fail.cpp index 8d864ea8e7da6..4ecd6c0415caf 100644 --- a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/copy_assign.fail.cpp +++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/copy_assign.fail.cpp @@ -20,8 +20,8 @@ int main() { { typedef std::mutex M; - M m0; - M m1; + M m0; + M m1; std::unique_lock<M> lk0(m0); std::unique_lock<M> lk1(m1); lk1 = lk0; diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/move_assign.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/move_assign.pass.cpp index 6f17383298fd1..2d5feabf8d297 100644 --- a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/move_assign.pass.cpp +++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/move_assign.pass.cpp @@ -23,8 +23,8 @@ int main() { { typedef std::mutex M; - M m0; - M m1; + M m0; + M m1; std::unique_lock<M> lk0(m0); std::unique_lock<M> lk1(m1); lk1 = std::move(lk0); @@ -35,8 +35,8 @@ int main() } { typedef nasty_mutex M; - M m0; - M m1; + M m0; + M m1; std::unique_lock<M> lk0(m0); std::unique_lock<M> lk1(m1); lk1 = std::move(lk0); diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex.pass.cpp index ca8bc69822531..dcfdfd11a7e15 100644 --- a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex.pass.cpp +++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex.pass.cpp @@ -54,7 +54,7 @@ int main() t.join(); #ifdef __cpp_deduction_guides - std::unique_lock ul(m); + std::unique_lock ul(m); static_assert((std::is_same<decltype(ul), std::unique_lock<decltype(m)>>::value), "" ); #endif } diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock.pass.cpp index 709c56978af80..3f7bd25a5e848 100644 --- a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock.pass.cpp +++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock.pass.cpp @@ -43,7 +43,7 @@ int main() #ifndef TEST_HAS_NO_EXCEPTIONS try { - lk.try_lock(); + TEST_IGNORE_NODISCARD lk.try_lock(); assert(false); } catch (std::system_error& e) @@ -59,7 +59,7 @@ int main() #ifndef TEST_HAS_NO_EXCEPTIONS try { - lk.try_lock(); + TEST_IGNORE_NODISCARD lk.try_lock(); assert(false); } catch (std::system_error& e) diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_for.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_for.pass.cpp index 6c981787d4b4a..b735904410253 100644 --- a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_for.pass.cpp +++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_for.pass.cpp @@ -48,7 +48,7 @@ int main() #ifndef TEST_HAS_NO_EXCEPTIONS try { - lk.try_lock_for(ms(5)); + TEST_IGNORE_NODISCARD lk.try_lock_for(ms(5)); assert(false); } catch (std::system_error& e) @@ -64,7 +64,7 @@ int main() #ifndef TEST_HAS_NO_EXCEPTIONS try { - lk.try_lock_for(ms(5)); + TEST_IGNORE_NODISCARD lk.try_lock_for(ms(5)); assert(false); } catch (std::system_error& e) diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_until.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_until.pass.cpp index 57231b207a726..c8d0aad6f82fa 100644 --- a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_until.pass.cpp +++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_until.pass.cpp @@ -48,7 +48,7 @@ int main() #ifndef TEST_HAS_NO_EXCEPTIONS try { - lk.try_lock_until(Clock::now()); + TEST_IGNORE_NODISCARD lk.try_lock_until(Clock::now()); assert(false); } catch (std::system_error& e) @@ -64,7 +64,7 @@ int main() #ifndef TEST_HAS_NO_EXCEPTIONS try { - lk.try_lock_until(Clock::now()); + TEST_IGNORE_NODISCARD lk.try_lock_until(Clock::now()); assert(false); } catch (std::system_error& e) diff --git a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/default.pass.cpp b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/default.pass.cpp index c61a93aa0c7fd..3ac901520978b 100644 --- a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/default.pass.cpp +++ b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/default.pass.cpp @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// // // UNSUPPORTED: libcpp-has-no-threads -// UNSUPPORTED: c++03, c++98, c++11, c++14 +// UNSUPPORTED: c++98, c++03, c++11, c++14 // <shared_mutex> diff --git a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/lock.pass.cpp b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/lock.pass.cpp index 0a6d6e3683ed7..efc4d3254a0f4 100644 --- a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/lock.pass.cpp +++ b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/lock.pass.cpp @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// // // UNSUPPORTED: libcpp-has-no-threads -// UNSUPPORTED: c++03, c++98, c++11, c++14 +// UNSUPPORTED: c++98, c++03, c++11, c++14 // FLAKY_TEST. diff --git a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/lock_shared.pass.cpp b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/lock_shared.pass.cpp index b7edc50978d24..72f74d551aa04 100644 --- a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/lock_shared.pass.cpp +++ b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/lock_shared.pass.cpp @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// // // UNSUPPORTED: libcpp-has-no-threads -// UNSUPPORTED: c++03, c++98, c++11, c++14 +// UNSUPPORTED: c++98, c++03, c++11, c++14 // FLAKY_TEST. diff --git a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/try_lock.pass.cpp b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/try_lock.pass.cpp index 6f3ca24a45586..f22f44c6d19d1 100644 --- a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/try_lock.pass.cpp +++ b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/try_lock.pass.cpp @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// // // UNSUPPORTED: libcpp-has-no-threads -// UNSUPPORTED: c++03, c++98, c++11, c++14 +// UNSUPPORTED: c++98, c++03, c++11, c++14 // <shared_mutex> diff --git a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/try_lock_shared.pass.cpp b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/try_lock_shared.pass.cpp index f615981bc94d2..d2d486a8b079b 100644 --- a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/try_lock_shared.pass.cpp +++ b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/try_lock_shared.pass.cpp @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// // // UNSUPPORTED: libcpp-has-no-threads -// UNSUPPORTED: c++03, c++98, c++11, c++14 +// UNSUPPORTED: c++98, c++03, c++11, c++14 // FLAKY_TEST. diff --git a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/default.pass.cpp b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/default.pass.cpp index 45cd563f94076..a4e7670e796a0 100644 --- a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/default.pass.cpp +++ b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/default.pass.cpp @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// // // UNSUPPORTED: libcpp-has-no-threads -// UNSUPPORTED: c++03, c++98, c++11 +// UNSUPPORTED: c++98, c++03, c++11 // <shared_mutex> diff --git a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/lock.pass.cpp b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/lock.pass.cpp index 83979d4c4e51f..0e173b0a1672a 100644 --- a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/lock.pass.cpp +++ b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/lock.pass.cpp @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// // // UNSUPPORTED: libcpp-has-no-threads -// UNSUPPORTED: c++03, c++98, c++11 +// UNSUPPORTED: c++98, c++03, c++11 // FLAKY_TEST. diff --git a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/lock_shared.pass.cpp b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/lock_shared.pass.cpp index 516f43192580d..753d65d12f891 100644 --- a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/lock_shared.pass.cpp +++ b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/lock_shared.pass.cpp @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// // // UNSUPPORTED: libcpp-has-no-threads -// UNSUPPORTED: c++03, c++98, c++11 +// UNSUPPORTED: c++98, c++03, c++11 // FLAKY_TEST. diff --git a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock.pass.cpp b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock.pass.cpp index 61900ba83342e..fbe3cdcd53505 100644 --- a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock.pass.cpp +++ b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock.pass.cpp @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// // // UNSUPPORTED: libcpp-has-no-threads -// UNSUPPORTED: c++03, c++98, c++11 +// UNSUPPORTED: c++98, c++03, c++11 // <shared_mutex> diff --git a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_for.pass.cpp b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_for.pass.cpp index 3d36911889b11..e562c99e382b5 100644 --- a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_for.pass.cpp +++ b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_for.pass.cpp @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// // // UNSUPPORTED: libcpp-has-no-threads -// UNSUPPORTED: c++03, c++98, c++11 +// UNSUPPORTED: c++98, c++03, c++11 // FLAKY_TEST. diff --git a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared.pass.cpp b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared.pass.cpp index 452fc3c19d65a..b5fdbdec32ba0 100644 --- a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared.pass.cpp +++ b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared.pass.cpp @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// // // UNSUPPORTED: libcpp-has-no-threads -// UNSUPPORTED: c++03, c++98, c++11 +// UNSUPPORTED: c++98, c++03, c++11 // FLAKY_TEST. diff --git a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared_for.pass.cpp b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared_for.pass.cpp index f478a29367a1e..69d71bf481536 100644 --- a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared_for.pass.cpp +++ b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared_for.pass.cpp @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// // // UNSUPPORTED: libcpp-has-no-threads -// UNSUPPORTED: c++03, c++98, c++11 +// UNSUPPORTED: c++98, c++03, c++11 // FLAKY_TEST. diff --git a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared_until.pass.cpp b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared_until.pass.cpp index f33edfc1a534f..ba135a95732b5 100644 --- a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared_until.pass.cpp +++ b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared_until.pass.cpp @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// // // UNSUPPORTED: libcpp-has-no-threads -// UNSUPPORTED: c++03, c++98, c++11 +// UNSUPPORTED: c++98, c++03, c++11 // FLAKY_TEST. diff --git a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_until.pass.cpp b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_until.pass.cpp index d5715c76f4587..559cf8f266c50 100644 --- a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_until.pass.cpp +++ b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_until.pass.cpp @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// // // UNSUPPORTED: libcpp-has-no-threads -// UNSUPPORTED: c++03, c++98, c++11 +// UNSUPPORTED: c++98, c++03, c++11 // FLAKY_TEST. diff --git a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_until_deadlock_bug.pass.cpp b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_until_deadlock_bug.pass.cpp index ed288099c9790..0caea1d092415 100644 --- a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_until_deadlock_bug.pass.cpp +++ b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_until_deadlock_bug.pass.cpp @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// // // UNSUPPORTED: libcpp-has-no-threads -// UNSUPPORTED: c++03, c++98, c++11 +// UNSUPPORTED: c++98, c++03, c++11 // <shared_mutex> diff --git a/test/std/thread/thread.mutex/thread.once/thread.once.onceflag/default.pass.cpp b/test/std/thread/thread.mutex/thread.once/thread.once.onceflag/default.pass.cpp index 21011ed17cd96..62f1b784b7d95 100644 --- a/test/std/thread/thread.mutex/thread.once/thread.once.onceflag/default.pass.cpp +++ b/test/std/thread/thread.mutex/thread.once/thread.once.onceflag/default.pass.cpp @@ -20,10 +20,12 @@ int main() { { std::once_flag f; + (void)f; } #if TEST_STD_VER >= 11 { constexpr std::once_flag f; + (void)f; } #endif } diff --git a/test/std/thread/thread.threads/thread.thread.this/sleep_until.pass.cpp b/test/std/thread/thread.threads/thread.thread.this/sleep_until.pass.cpp index 9f3941b93adfc..6b622029365ce 100644 --- a/test/std/thread/thread.threads/thread.thread.this/sleep_until.pass.cpp +++ b/test/std/thread/thread.threads/thread.thread.this/sleep_until.pass.cpp @@ -22,7 +22,6 @@ int main() { typedef std::chrono::system_clock Clock; typedef Clock::time_point time_point; - typedef Clock::duration duration; std::chrono::milliseconds ms(500); time_point t0 = Clock::now(); std::this_thread::sleep_until(t0 + ms); |
