[clang-tools-extra] r333742 - [clangd] Attempt the fix the buildbots after r333737

Ilya Biryukov via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 1 05:03:16 PDT 2018


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:




More information about the cfe-commits mailing list