diff --git a/libcxx/test/std/thread/thread.condition/thread.condition.condvarany/notify_all.pass.cpp b/libcxx/test/std/thread/thread.condition/thread.condition.condvarany/notify_all.pass.cpp index 0e19e5925eeb..36428bc7fc50 100644 --- a/libcxx/test/std/thread/thread.condition/thread.condition.condvarany/notify_all.pass.cpp +++ b/libcxx/test/std/thread/thread.condition/thread.condition.condvarany/notify_all.pass.cpp @@ -44,9 +44,9 @@ void helper() { int main(int, char**) { notReady = threadCount; - std::vector threads; + std::vector threads(threadCount); for (unsigned i = 0; i < threadCount; i++) - threads.emplace_back(helper); + threads[i] = std::thread(helper); { while (notReady > 0) std::this_thread::yield();