[clang-tools-extra] r303263 - [clang-tidy] Replace matchesName with hasName where no regex is needed

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Wed May 17 07:39:40 PDT 2017


Author: alexfh
Date: Wed May 17 09:39:39 2017
New Revision: 303263

URL: http://llvm.org/viewvc/llvm-project?rev=303263&view=rev
Log:
[clang-tidy] Replace matchesName with hasName where no regex is needed

Modified:
    clang-tools-extra/trunk/clang-tidy/modernize/MakeSharedCheck.cpp
    clang-tools-extra/trunk/clang-tidy/modernize/MakeUniqueCheck.cpp

Modified: clang-tools-extra/trunk/clang-tidy/modernize/MakeSharedCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/MakeSharedCheck.cpp?rev=303263&r1=303262&r2=303263&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/modernize/MakeSharedCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/modernize/MakeSharedCheck.cpp Wed May 17 09:39:39 2017
@@ -21,7 +21,7 @@ MakeSharedCheck::MakeSharedCheck(StringR
 MakeSharedCheck::SmartPtrTypeMatcher
 MakeSharedCheck::getSmartPointerTypeMatcher() const {
   return qualType(hasDeclaration(classTemplateSpecializationDecl(
-      matchesName("::std::shared_ptr"), templateArgumentCountIs(1),
+      hasName("::std::shared_ptr"), templateArgumentCountIs(1),
       hasTemplateArgument(
           0, templateArgument(refersToType(qualType().bind(PointerType)))))));
 }

Modified: clang-tools-extra/trunk/clang-tidy/modernize/MakeUniqueCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/MakeUniqueCheck.cpp?rev=303263&r1=303262&r2=303263&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/modernize/MakeUniqueCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/modernize/MakeUniqueCheck.cpp Wed May 17 09:39:39 2017
@@ -22,17 +22,17 @@ MakeUniqueCheck::MakeUniqueCheck(StringR
 MakeUniqueCheck::SmartPtrTypeMatcher
 MakeUniqueCheck::getSmartPointerTypeMatcher() const {
   return qualType(hasDeclaration(classTemplateSpecializationDecl(
-      matchesName("::std::unique_ptr"), templateArgumentCountIs(2),
+      hasName("::std::unique_ptr"), templateArgumentCountIs(2),
       hasTemplateArgument(
           0, templateArgument(refersToType(qualType().bind(PointerType)))),
       hasTemplateArgument(
-          1, templateArgument(refersToType(
-                 qualType(hasDeclaration(classTemplateSpecializationDecl(
-                     matchesName("::std::default_delete"),
-                     templateArgumentCountIs(1),
-                     hasTemplateArgument(
-                         0, templateArgument(refersToType(qualType(
-                                equalsBoundNode(PointerType))))))))))))));
+          1,
+          templateArgument(refersToType(
+              qualType(hasDeclaration(classTemplateSpecializationDecl(
+                  hasName("::std::default_delete"), templateArgumentCountIs(1),
+                  hasTemplateArgument(
+                      0, templateArgument(refersToType(
+                             qualType(equalsBoundNode(PointerType))))))))))))));
 }
 
 } // namespace modernize




More information about the cfe-commits mailing list