Author: aaronballman Date: Wed Aug 19 14:29:23 2015 New Revision: 245484 URL: http://llvm.org/viewvc/llvm-project?rev=245484&view=rev Log: Replacing a custom AST matcher with some builtin AST matchers; NFC, and existing tests should provide sufficient coverage.
Modified: clang-tools-extra/trunk/clang-modernize/PassByValue/PassByValueMatchers.cpp Modified: clang-tools-extra/trunk/clang-modernize/PassByValue/PassByValueMatchers.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-modernize/PassByValue/PassByValueMatchers.cpp?rev=245484&r1=245483&r2=245484&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-modernize/PassByValue/PassByValueMatchers.cpp (original) +++ clang-tools-extra/trunk/clang-modernize/PassByValue/PassByValueMatchers.cpp Wed Aug 19 14:29:23 2015 @@ -44,19 +44,6 @@ AST_MATCHER(CXXRecordDecl, isMoveConstru } return false; } - -/// \brief Matches non-deleted copy constructors. -/// -/// Given -/// \code -/// struct Foo { Foo(const Foo &) = default; }; -/// struct Bar { Bar(const Bar &) = deleted; }; -/// \endcode -/// constructorDecl(isNonDeletedCopyConstructor()) -/// matches "Foo(const Foo &)". -AST_MATCHER(CXXConstructorDecl, isNonDeletedCopyConstructor) { - return Node.isCopyConstructor() && !Node.isDeleted(); -} } // namespace ast_matchers } // namespace clang @@ -87,7 +74,7 @@ DeclarationMatcher makePassByValueCtorPa anyOf(constRefType(), nonConstValueType())))) .bind(PassByValueParamId)))), hasDeclaration(constructorDecl( - isNonDeletedCopyConstructor(), + isCopyConstructor(), unless(isDeleted()), hasDeclContext(recordDecl(isMoveConstructible()))))))) .bind(PassByValueInitializerId))) .bind(PassByValueCtorId); _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits