[llvm] r255678 - Fix clang-cl self-host with MSVC 2013 STL std::bind implementation

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 15 13:41:59 PST 2015


Author: rnk
Date: Tue Dec 15 15:41:58 2015
New Revision: 255678

URL: http://llvm.org/viewvc/llvm-project?rev=255678&view=rev
Log:
Fix clang-cl self-host with MSVC 2013 STL std::bind implementation

Modified:
    llvm/trunk/include/llvm/Support/ThreadPool.h

Modified: llvm/trunk/include/llvm/Support/ThreadPool.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/ThreadPool.h?rev=255678&r1=255677&r2=255678&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/ThreadPool.h (original)
+++ llvm/trunk/include/llvm/Support/ThreadPool.h Tue Dec 15 15:41:58 2015
@@ -70,7 +70,12 @@ public:
 #ifndef _MSC_VER
     return asyncImpl(std::move(Task));
 #else
-    return asyncImpl([Task] (VoidTy) -> VoidTy { Task(); return VoidTy(); });
+    // This lambda has to be marked mutable because MSVC 2013's std::bind call
+    // operator isn't const qualified.
+    return asyncImpl([Task](VoidTy) mutable -> VoidTy {
+      Task();
+      return VoidTy();
+    });
 #endif
   }
 




More information about the llvm-commits mailing list