[clang-tools-extra] b36b889 - Explicitly move from llvm::json Array/Object to Value

Sam McCall via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 20 06:18:59 PDT 2020


Author: Michael Forster
Date: 2020-04-20T15:18:52+02:00
New Revision: b36b889a3b81b893c220c1858d16493152b36852

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

LOG: Explicitly move from llvm::json Array/Object to Value

Summary: The implicit conversion fails under Clang 3.8.

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: jkorous, arphaman, kadircet, usaxena95, cfe-commits

Tags: #clang

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

Added: 
    

Modified: 
    clang-tools-extra/clangd/Protocol.cpp

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clangd/Protocol.cpp b/clang-tools-extra/clangd/Protocol.cpp
index 5756e3b02871..b0c7ce2acb33 100644
--- a/clang-tools-extra/clangd/Protocol.cpp
+++ b/clang-tools-extra/clangd/Protocol.cpp
@@ -1002,7 +1002,7 @@ static llvm::json::Value encodeTokens(llvm::ArrayRef<SemanticToken> Toks) {
     Result.push_back(Tok.tokenModifiers);
   }
   assert(Result.size() == SemanticTokenEncodingSize * Toks.size());
-  return Result;
+  return std::move(Result);
 }
 
 bool operator==(const SemanticToken &L, const SemanticToken &R) {
@@ -1030,7 +1030,7 @@ llvm::json::Value toJSON(const SemanticTokensOrEdits &TE) {
     Result["edits"] = *TE.edits;
   if (TE.tokens)
     Result["data"] = encodeTokens(*TE.tokens);
-  return Result;
+  return std::move(Result);
 }
 
 bool fromJSON(const llvm::json::Value &Params, SemanticTokensParams &R) {


        


More information about the cfe-commits mailing list