]> granicus.if.org Git - llvm/commitdiff
Make appendCallNB lambda mutable
authorChris Bieneman <chris.bieneman@me.com>
Thu, 19 Sep 2019 15:45:12 +0000 (15:45 +0000)
committerChris Bieneman <chris.bieneman@me.com>
Thu, 19 Sep 2019 15:45:12 +0000 (15:45 +0000)
Lambdas are by deafult const so that they produce the same output every time they are run. This lambda needs to set the value on a captured promise which is a mutating operation, so it must be mutable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372336 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ExecutionEngine/Orc/RPCUtils.h

index caea3bea997ea9fc68e8afa29402a57943f1ffbe..ee9c2cc69c30e0023cc3f8a89687f25be70d912b 100644 (file)
@@ -1417,7 +1417,7 @@ public:
     auto FutureResult = Promise.get_future();
 
     if (auto Err = this->template appendCallAsync<Func>(
-            [Promise = std::move(Promise)](ErrorReturn RetOrErr) {
+            [Promise = std::move(Promise)](ErrorReturn RetOrErr) mutable {
               Promise.set_value(std::move(RetOrErr));
               return Error::success();
             },