Fix template parameter pack handling in ThreadPool
[oota-llvm.git] / include / llvm / Support / ThreadPool.h
index 56265499c3e5f035e70c457bcc2cbec555303d48..85c062179f056bec14c144b43242a965c8cc884e 100644 (file)
 
 #include "llvm/Support/thread.h"
 
+#ifdef _MSC_VER
+// concrt.h depends on eh.h for __uncaught_exception declaration
+// even if we disable exceptions.
+#include <eh.h>
+#endif
+
 #include <condition_variable>
 #include <functional>
 #include <future>
@@ -60,7 +66,7 @@ public:
   template <typename Function, typename... Args>
   inline std::shared_future<VoidTy> async(Function &&F, Args &&... ArgList) {
     auto Task =
-        std::bind(std::forward<Function>(F), std::forward<Args...>(ArgList...));
+        std::bind(std::forward<Function>(F), std::forward<Args>(ArgList)...);
 #ifndef _MSC_VER
     return asyncImpl(std::move(Task));
 #else