Fix clang-cl self-host with MSVC 2013 STL std::bind implementation
[oota-llvm.git] / include / llvm / Support / ThreadPool.h
index 85c062179f056bec14c144b43242a965c8cc884e..5648db0642afb1abe8cf5fca7dd21ff65518bc10 100644 (file)
@@ -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
   }