summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-modernize/PassByValue/PassByValueMatchers.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/clang-modernize/PassByValue/PassByValueMatchers.cpp')
-rw-r--r--clang-tools-extra/clang-modernize/PassByValue/PassByValueMatchers.cpp15
1 files changed, 1 insertions, 14 deletions
diff --git a/clang-tools-extra/clang-modernize/PassByValue/PassByValueMatchers.cpp b/clang-tools-extra/clang-modernize/PassByValue/PassByValueMatchers.cpp
index 1a0cbcf5ef9..c6ee6a8067f 100644
--- a/clang-tools-extra/clang-modernize/PassByValue/PassByValueMatchers.cpp
+++ b/clang-tools-extra/clang-modernize/PassByValue/PassByValueMatchers.cpp
@@ -44,19 +44,6 @@ AST_MATCHER(CXXRecordDecl, isMoveConstructible) {
}
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 makePassByValueCtorParamMatcher() {
anyOf(constRefType(), nonConstValueType()))))
.bind(PassByValueParamId)))),
hasDeclaration(constructorDecl(
- isNonDeletedCopyConstructor(),
+ isCopyConstructor(), unless(isDeleted()),
hasDeclContext(recordDecl(isMoveConstructible())))))))
.bind(PassByValueInitializerId)))
.bind(PassByValueCtorId);
OpenPOWER on IntegriCloud