From: Reid Kleckner Date: Tue, 15 Dec 2015 21:41:58 +0000 (+0000) Subject: Fix clang-cl self-host with MSVC 2013 STL std::bind implementation X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=94db25b2d6d71ab3aa485357eccea0bc8c89650d;p=oota-llvm.git Fix clang-cl self-host with MSVC 2013 STL std::bind implementation git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255678 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Support/ThreadPool.h b/include/llvm/Support/ThreadPool.h index 85c062179f0..5648db0642a 100644 --- a/include/llvm/Support/ThreadPool.h +++ b/include/llvm/Support/ThreadPool.h @@ -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 }