Author: ibiryukov Date: Fri Jun 1 05:03:16 2018 New Revision: 333742 URL: http://llvm.org/viewvc/llvm-project?rev=333742&view=rev Log: [clangd] Attempt the fix the buildbots after r333737
Modified: clang-tools-extra/trunk/clangd/TUScheduler.cpp Modified: clang-tools-extra/trunk/clangd/TUScheduler.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/TUScheduler.cpp?rev=333742&r1=333741&r2=333742&view=diff ============================================================================== --- clang-tools-extra/trunk/clangd/TUScheduler.cpp (original) +++ clang-tools-extra/trunk/clangd/TUScheduler.cpp Fri Jun 1 05:03:16 2018 @@ -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: _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits