[clang-tools-extra] 6527201 - [clang-tidy] Remove a duplicated if-branch in the unused-using-decl

Haojian Wu via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 18 06:07:59 PST 2022


Author: Haojian Wu
Date: 2022-11-18T15:07:46+01:00
New Revision: 6527201414cf9479639594a7a1f80558ec09d106

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

LOG: [clang-tidy] Remove a duplicated if-branch in the unused-using-decl
check, NFC

Added: 
    

Modified: 
    clang-tools-extra/clang-tidy/misc/UnusedUsingDeclsCheck.cpp

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clang-tidy/misc/UnusedUsingDeclsCheck.cpp b/clang-tools-extra/clang-tidy/misc/UnusedUsingDeclsCheck.cpp
index 02aa786aa8449..244cf719b5a8c 100644
--- a/clang-tools-extra/clang-tidy/misc/UnusedUsingDeclsCheck.cpp
+++ b/clang-tools-extra/clang-tidy/misc/UnusedUsingDeclsCheck.cpp
@@ -107,9 +107,6 @@ void UnusedUsingDeclsCheck::check(const MatchFinder::MatchResult &Result) {
     } else if (const auto *Specialization =
                    dyn_cast<ClassTemplateSpecializationDecl>(Used)) {
       removeFromFoundDecls(Specialization->getSpecializedTemplate());
-    } else if (const auto *FD = dyn_cast<FunctionDecl>(Used)) {
-      if (const auto *FDT = FD->getPrimaryTemplate())
-        removeFromFoundDecls(FDT);
     } else if (const auto *ECD = dyn_cast<EnumConstantDecl>(Used)) {
       if (const auto *ET = ECD->getType()->getAs<EnumType>())
         removeFromFoundDecls(ET->getDecl());


        


More information about the cfe-commits mailing list