summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clangd/TUScheduler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/clangd/TUScheduler.cpp')
-rw-r--r--clang-tools-extra/clangd/TUScheduler.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang-tools-extra/clangd/TUScheduler.cpp b/clang-tools-extra/clangd/TUScheduler.cpp
index c6b11437d31..795023cfa4f 100644
--- a/clang-tools-extra/clangd/TUScheduler.cpp
+++ b/clang-tools-extra/clangd/TUScheduler.cpp
@@ -110,7 +110,10 @@ public:
return llvm::None;
std::unique_ptr<ParsedAST> V = std::move(Existing->second);
LRU.erase(Existing);
- return V;
+ // GCC 4.8 fails to compile `return V;`, as it tries to call the copy
+ // constructor of unique_ptr, so we call the move ctor explicitly to avoid
+ // this miscompile.
+ return llvm::Optional<std::unique_ptr<ParsedAST>>(std::move(V));
}
private:
OpenPOWER on IntegriCloud