From 6608235b0d93ac36867658aa8a4e441a0be691dc Mon Sep 17 00:00:00 2001 From: Evan Wilde Date: Mon, 16 Oct 2023 23:49:13 -0700 Subject: [PATCH] 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. --- lib/Frontend/CachingUtils.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Frontend/CachingUtils.cpp b/lib/Frontend/CachingUtils.cpp index e51a695bafdd2..43c64760c8cf9 100644 --- a/lib/Frontend/CachingUtils.cpp +++ b/lib/Frontend/CachingUtils.cpp @@ -90,7 +90,7 @@ Expected cas::CachedResultLoader::replay(CallbackTy Callback) { [&](swift::cas::CompileJobCacheResult::Output Output) -> Error { return Callback(Output.Kind, Output.Object); })) - return Err; + return std::move(Err); return true; } @@ -120,7 +120,7 @@ Expected cas::CachedResultLoader::replay(CallbackTy Callback) { "Unexpected output kind in clang cached result"); return Callback(OutputKind, Output.Object); })) - return Err; + return std::move(Err); return true; }