Author: ericwf
Date: Wed Jun 22 00:44:08 2016
New Revision: 273385

URL: http://llvm.org/viewvc/llvm-project?rev=273385&view=rev
Log:
Placate MSVC's unchecked malloc warning in thread tests.

Modified:
    
libcxx/trunk/test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp

Modified: 
libcxx/trunk/test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp?rev=273385&r1=273384&r2=273385&view=diff
==============================================================================
--- 
libcxx/trunk/test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp
 (original)
+++ 
libcxx/trunk/test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp
 Wed Jun 22 00:44:08 2016
@@ -36,7 +36,9 @@ void* operator new(std::size_t s) throw(
         throw std::bad_alloc();
     --throw_one;
     ++outstanding_new;
-    return std::malloc(s);
+    void* ret = std::malloc(s);
+    if (!ret) std::abort(); // placate MSVC's unchecked malloc warning
+    return ret;
 }
 
 void  operator delete(void* p) throw()


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

Reply via email to