[clang-tools-extra] a3220df - [clangd] Add std::move() to a return statement to please some compilers.

Martin Boehme via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 3 06:41:47 PDT 2020


Author: Martin Boehme
Date: 2020-06-03T15:40:01+02:00
New Revision: a3220dffcb1da0cfe3e22a336141c76c78d474b7

URL: https://github.com/llvm/llvm-project/commit/a3220dffcb1da0cfe3e22a336141c76c78d474b7
DIFF: https://github.com/llvm/llvm-project/commit/a3220dffcb1da0cfe3e22a336141c76c78d474b7.diff

LOG: [clangd] Add std::move() to a return statement to please some compilers.

This has been causing build errors in Swift CI.

Differential Revision: https://reviews.llvm.org/D81079

Added: 
    

Modified: 
    clang-tools-extra/clangd/index/FileIndex.cpp

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clangd/index/FileIndex.cpp b/clang-tools-extra/clangd/index/FileIndex.cpp
index 79ec1120df98..1a18af1303dd 100644
--- a/clang-tools-extra/clangd/index/FileIndex.cpp
+++ b/clang-tools-extra/clangd/index/FileIndex.cpp
@@ -201,7 +201,8 @@ FileShardedIndex::getShard(llvm::StringRef Uri) const {
     RelB.insert(*Rel);
   }
   IF.Relations = std::move(RelB).build();
-  return IF;
+  // Explicit move here is needed by some compilers.
+  return std::move(IF);
 }
 
 SlabTuple indexMainDecls(ParsedAST &AST) {


        


More information about the cfe-commits mailing list