aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam McCall <sam.mccall@gmail.com>2017-12-19 17:05:00 +0000
committerSam McCall <sam.mccall@gmail.com>2017-12-19 17:05:00 +0000
commit1686fcf87db079e17f0acc994ed5a3d0f690d4f0 (patch)
treebd9ec024a07f81fa468ca12d499937ae893e561c
parenta50f7cf406f7279f4bc875147e72aec4bd423f21 (diff)
[clangd] Fix warnings/compiler pickiness after r321083
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@321086 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--clangd/CodeComplete.cpp2
-rw-r--r--unittests/clangd/CodeCompleteTests.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/clangd/CodeComplete.cpp b/clangd/CodeComplete.cpp
index 226e8f8e..7e549a90 100644
--- a/clangd/CodeComplete.cpp
+++ b/clangd/CodeComplete.cpp
@@ -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.
diff --git a/unittests/clangd/CodeCompleteTests.cpp b/unittests/clangd/CodeCompleteTests.cpp
index 4e598d35..bbe0c8d1 100644
--- a/unittests/clangd/CodeCompleteTests.cpp
+++ b/unittests/clangd/CodeCompleteTests.cpp
@@ -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) {