summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/misc/AssignOperatorSignatureCheck.cpp
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2015-09-17 13:31:25 +0000
committerAaron Ballman <aaron@aaronballman.com>2015-09-17 13:31:25 +0000
commitb9ea09c4451cb8f33ffd41d22b7dd10e8a68c5c8 (patch)
tree362e33db9c2d4fb7ab5fc96172386893a7d50b10 /clang-tools-extra/clang-tidy/misc/AssignOperatorSignatureCheck.cpp
parent512fb64765c7d61e89531b8ff697a85d815d9a13 (diff)
downloadbcm5719-llvm-b9ea09c4451cb8f33ffd41d22b7dd10e8a68c5c8.tar.gz
bcm5719-llvm-b9ea09c4451cb8f33ffd41d22b7dd10e8a68c5c8.zip
Refactors AST matching code to use the new AST matcher names. This patch correlates to r247885 which performs the AST matcher rename in Clang.
llvm-svn: 247886
Diffstat (limited to 'clang-tools-extra/clang-tidy/misc/AssignOperatorSignatureCheck.cpp')
-rw-r--r--clang-tools-extra/clang-tidy/misc/AssignOperatorSignatureCheck.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/clang-tools-extra/clang-tidy/misc/AssignOperatorSignatureCheck.cpp b/clang-tools-extra/clang-tidy/misc/AssignOperatorSignatureCheck.cpp
index 7488d989def..a1ecfbd9d3c 100644
--- a/clang-tools-extra/clang-tidy/misc/AssignOperatorSignatureCheck.cpp
+++ b/clang-tools-extra/clang-tidy/misc/AssignOperatorSignatureCheck.cpp
@@ -24,20 +24,21 @@ void AssignOperatorSignatureCheck::registerMatchers(
if (!getLangOpts().CPlusPlus)
return;
- const auto HasGoodReturnType = methodDecl(returns(lValueReferenceType(pointee(
- unless(isConstQualified()), hasDeclaration(equalsBoundNode("class"))))));
+ const auto HasGoodReturnType = cxxMethodDecl(returns(
+ lValueReferenceType(pointee(unless(isConstQualified()),
+ hasDeclaration(equalsBoundNode("class"))))));
const auto IsSelf = qualType(
anyOf(hasDeclaration(equalsBoundNode("class")),
referenceType(pointee(hasDeclaration(equalsBoundNode("class"))))));
const auto IsSelfAssign =
- methodDecl(unless(anyOf(isDeleted(), isPrivate(), isImplicit())),
- hasName("operator="), ofClass(recordDecl().bind("class")),
- hasParameter(0, parmVarDecl(hasType(IsSelf))))
+ cxxMethodDecl(unless(anyOf(isDeleted(), isPrivate(), isImplicit())),
+ hasName("operator="), ofClass(recordDecl().bind("class")),
+ hasParameter(0, parmVarDecl(hasType(IsSelf))))
.bind("method");
Finder->addMatcher(
- methodDecl(IsSelfAssign, unless(HasGoodReturnType)).bind("ReturnType"),
+ cxxMethodDecl(IsSelfAssign, unless(HasGoodReturnType)).bind("ReturnType"),
this);
const auto BadSelf = referenceType(
@@ -45,11 +46,13 @@ void AssignOperatorSignatureCheck::registerMatchers(
rValueReferenceType(pointee(isConstQualified()))));
Finder->addMatcher(
- methodDecl(IsSelfAssign, hasParameter(0, parmVarDecl(hasType(BadSelf))))
+ cxxMethodDecl(IsSelfAssign,
+ hasParameter(0, parmVarDecl(hasType(BadSelf))))
.bind("ArgumentType"),
this);
- Finder->addMatcher(methodDecl(IsSelfAssign, isConst()).bind("Const"), this);
+ Finder->addMatcher(cxxMethodDecl(IsSelfAssign, isConst()).bind("Const"),
+ this);
}
OpenPOWER on IntegriCloud