[clangd] Attempt the fix the buildbots after r333737

llvm-svn: 333742
This commit is contained in:
Ilya Biryukov 2018-06-01 12:03:16 +00:00
parent 351aa594f6
commit cd16e559d2
1 changed files with 4 additions and 1 deletions

View File

@ -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: