diff options
Diffstat (limited to 'clang-tools-extra/clang-tidy/misc/AssignOperatorSignatureCheck.cpp')
-rw-r--r-- | clang-tools-extra/clang-tidy/misc/AssignOperatorSignatureCheck.cpp | 19 |
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); } |