CaseyCarter added a comment.

I'll put this explanation in the comments and push a change.



================
Comment at: 
test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp:121
 //    allocations.
+int numAllocs;
+
----------------
EricWF wrote:
> Why?
`main` non-portably assumes that thread creation results in at least one call 
to `::operator new`. This change fixes that assumption by counting the number 
of calls to `::operator new` here for creation of a do-nothing thread, and 
communicating that count to `main` via `numAllocs`.


================
Comment at: 
test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp:171
 #ifndef TEST_HAS_NO_EXCEPTIONS
-    {
+    if (numAllocs > 0) {
         try
----------------
EricWF wrote:
> I'm not sure I understand this change either.
> 
If thread creation in `test_throwing_new_during_thread_creation` resulted in 
`0` calls to `::operator new`, the expectation is that the same will occur here 
when we create a thread. If `::operator new` isn't called, it can't throw the 
exception this test is expecting to catch.


https://reviews.llvm.org/D50860



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to