Skip to content

Commit 6608235

Browse files
committed
Move llvm:Error types
Older compilers don't have the copy-elision of newer C++ compilers, resulting in an error message when returning a non-copyable type. Move llvm::Error instead of copying it.
1 parent 051ffc5 commit 6608235

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/Frontend/CachingUtils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ Expected<bool> cas::CachedResultLoader::replay(CallbackTy Callback) {
9090
[&](swift::cas::CompileJobCacheResult::Output Output) -> Error {
9191
return Callback(Output.Kind, Output.Object);
9292
}))
93-
return Err;
93+
return std::move(Err);
9494

9595
return true;
9696
}
@@ -120,7 +120,7 @@ Expected<bool> cas::CachedResultLoader::replay(CallbackTy Callback) {
120120
"Unexpected output kind in clang cached result");
121121
return Callback(OutputKind, Output.Object);
122122
}))
123-
return Err;
123+
return std::move(Err);
124124

125125
return true;
126126
}

0 commit comments

Comments
 (0)