Skip to content

Commit 9221663

Browse files
committed
Older versions of clang don't implicitly elide copy
Clang is supposed to build as far back as Clang 5, which doesn't elide the copy when returning errors resulting in an `error: call to deleted constructor of 'llvm::Error'`.
1 parent 02d3200 commit 9221663

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/lib/Frontend/CompileJobCache.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ Expected<std::optional<int>> CompileJobCache::replayCachedResult(
523523
.replayCachedResult(CacheKey, CachedResult,
524524
/*JustComputedResult*/ false)
525525
.moveInto(Ret))
526-
return E;
526+
return std::move(E);
527527

528528
if (Clang.getDiagnostics().hasErrorOccurred())
529529
return llvm::createStringError(llvm::inconvertibleErrorCode(),

0 commit comments

Comments
 (0)