[clangd] Fix warnings/compiler pickiness after r321083
authorSam McCall <sam.mccall@gmail.com>
Tue, 19 Dec 2017 17:05:00 +0000 (17:05 +0000)
committerSam McCall <sam.mccall@gmail.com>
Tue, 19 Dec 2017 17:05:00 +0000 (17:05 +0000)
llvm-svn: 321086

clang-tools-extra/clangd/CodeComplete.cpp
clang-tools-extra/unittests/clangd/CodeCompleteTests.cpp

index 226e8f8e768553ba45d2fbab7a1067c4402de772..7e549a9008c5a6a29fda5e2b06a9a176f43312c1 100644 (file)
@@ -784,7 +784,7 @@ SpecifiedScope extraCompletionScope(Sema &S, const CXXScopeSpec &SS) {
     DeclContext *DC = S.computeDeclContext(SS);
     if (auto *NS = llvm::dyn_cast<NamespaceDecl>(DC)) {
       Info.Resolved = NS->getQualifiedNameAsString();
-    } else if (auto *TU = llvm::dyn_cast<TranslationUnitDecl>(DC)) {
+    } else if (llvm::dyn_cast<TranslationUnitDecl>(DC) != nullptr) {
       Info.Resolved = "::";
       // Sema does not include the suffix "::" in the range of SS, so we add
       // it back here.
index 4e598d350bcc9d0313da9ab13f1e784e72c96040..bbe0c8d1ba9fa13bc656ef491581751db87edd5b 100644 (file)
@@ -488,7 +488,7 @@ std::unique_ptr<SymbolIndex> simpleIndexFromSymbols(
   auto S = std::shared_ptr<std::vector<const Symbol *>>(std::move(Snap),
                                                         &Snap->Pointers);
   I->build(std::move(S));
-  return I;
+  return std::move(I);
 }
 
 TEST(CompletionTest, NoIndex) {