[llvm] r335442 - Try to fix build error on non MSVC compilers.

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 24 21:35:36 PDT 2018


Author: zturner
Date: Sun Jun 24 21:35:35 2018
New Revision: 335442

URL: http://llvm.org/viewvc/llvm-project?rev=335442&view=rev
Log:
Try to fix build error on non MSVC compilers.

Modified:
    llvm/trunk/include/llvm/Support/TaskQueue.h

Modified: llvm/trunk/include/llvm/Support/TaskQueue.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/TaskQueue.h?rev=335442&r1=335441&r2=335442&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/TaskQueue.h (original)
+++ llvm/trunk/include/llvm/Support/TaskQueue.h Sun Jun 24 21:35:35 2018
@@ -44,17 +44,19 @@ class TaskQueue {
         : C(std::move(C)), P(std::make_shared<std::promise<ResultTy>>()),
           Parent(&Parent) {}
 
-    template <typename T> void invokeCallbackAndSetPromise() {
+    template<typename T>
+    void invokeCallbackAndSetPromise(T*) {
       P->set_value(C());
     }
 
-    template <> void invokeCallbackAndSetPromise<void>() {
+    void invokeCallbackAndSetPromise(void*) {
       C();
       P->set_value();
     }
 
     void operator()() noexcept {
-      invokeCallbackAndSetPromise<ResultTy>();
+      ResultTy *Dummy = nullptr;
+      invokeCallbackAndSetPromise(Dummy);
       Parent->completeTask();
     }
 




More information about the llvm-commits mailing list