From 94db25b2d6d71ab3aa485357eccea0bc8c89650d Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Tue, 15 Dec 2015 21:41:58 +0000 Subject: [PATCH] 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 --- include/llvm/Support/ThreadPool.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 } -- 2.34.1