From b6dfee2d734a63656dca3d4e844984b393efd83d 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 llvm-svn: 255678 --- llvm/include/llvm/Support/ThreadPool.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/llvm/include/llvm/Support/ThreadPool.h b/llvm/include/llvm/Support/ThreadPool.h index 85c062179f05..5648db0642af 100644 --- a/llvm/include/llvm/Support/ThreadPool.h +++ b/llvm/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 }