diff --git a/libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp b/libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp --- a/libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp +++ b/libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include "test_macros.h" @@ -51,10 +52,12 @@ bool f_run = false; -void f() -{ - f_run = true; -} +struct F { + std::vector v_; // so f's copy-ctor calls operator new + explicit F() : v_(10) {} + void operator()() const { f_run = true; } +}; +F f; class G {