Index: test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp =================================================================== --- test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp +++ test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp @@ -157,8 +157,11 @@ { assert(G::n_alive == 0); assert(!G::op_run); - std::thread t((G())); - t.join(); + { + G g; + std::thread t(g); + t.join(); + } assert(G::n_alive == 0); assert(G::op_run); } @@ -185,8 +188,11 @@ { assert(G::n_alive == 0); assert(!G::op_run); - std::thread t(G(), 5, 5.5); - t.join(); + { + G g; + std::thread t(g, 5, 5.5); + t.join(); + } assert(G::n_alive == 0); assert(G::op_run); } Index: test/std/thread/thread.threads/thread.thread.class/thread.thread.member/detach.pass.cpp =================================================================== --- test/std/thread/thread.threads/thread.thread.class/thread.thread.member/detach.pass.cpp +++ test/std/thread/thread.threads/thread.thread.class/thread.thread.member/detach.pass.cpp @@ -29,8 +29,8 @@ int alive_; bool done_; public: - static int n_alive; - static bool op_run; + static std::atomic_int n_alive; + static std::atomic_bool op_run; G() : alive_(1), done_(false) { @@ -57,8 +57,8 @@ } }; -int G::n_alive = 0; -bool G::op_run = false; +std::atomic_int G::n_alive = 0; +std::atomic_bool G::op_run = false; void foo() {}