diff --git a/clang-tools-extra/clangd/ConfigYAML.cpp b/clang-tools-extra/clangd/ConfigYAML.cpp --- a/clang-tools-extra/clangd/ConfigYAML.cpp +++ b/clang-tools-extra/clangd/ConfigYAML.cpp @@ -349,8 +349,7 @@ if (auto Scalar = scalarValue(N, Desc)) { if (auto Bool = llvm::yaml::parseBool(**Scalar)) return Located(*Bool, Scalar->Range); - else - warning(Desc + " should be a boolean", N); + warning(Desc + " should be a boolean", N); } return llvm::None; } diff --git a/clang-tools-extra/clangd/XRefs.cpp b/clang-tools-extra/clangd/XRefs.cpp --- a/clang-tools-extra/clangd/XRefs.cpp +++ b/clang-tools-extra/clangd/XRefs.cpp @@ -1928,9 +1928,9 @@ // FIXME: use HeuristicResolver to unwrap smart pointers? // Function type => return type. - if (auto FT = T->getAs()) + if (auto *FT = T->getAs()) return unwrapFindType(FT->getReturnType()); - if (auto CRD = T->getAsCXXRecordDecl()) { + if (auto *CRD = T->getAsCXXRecordDecl()) { if (CRD->isLambda()) return unwrapFindType(CRD->getLambdaCallOperator()->getReturnType()); // FIXME: more cases we'd prefer the return type of the call operator? diff --git a/clang-tools-extra/clangd/refactor/tweaks/AddUsing.cpp b/clang-tools-extra/clangd/refactor/tweaks/AddUsing.cpp --- a/clang-tools-extra/clangd/refactor/tweaks/AddUsing.cpp +++ b/clang-tools-extra/clangd/refactor/tweaks/AddUsing.cpp @@ -254,8 +254,9 @@ if (auto *T = Node->ASTNode.get()) { if (T->getAs()) { break; - } else if (Node->Parent->ASTNode.get() || - Node->Parent->ASTNode.get()) { + } + if (Node->Parent->ASTNode.get() || + Node->Parent->ASTNode.get()) { // Node is TypeLoc, but it's parent is either TypeLoc or // NestedNameSpecifier. In both cases, we want to go up, to find // the outermost TypeLoc. diff --git a/clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp b/clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp --- a/clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp +++ b/clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp @@ -42,7 +42,6 @@ using ::testing::Pair; using ::testing::SizeIs; using ::testing::UnorderedElementsAre; -using testing::UnorderedElementsAreArray; ::testing::Matcher withFix(::testing::Matcher FixMatcher) { return Field(&Diag::Fixes, ElementsAre(FixMatcher));