aboutsummaryrefslogtreecommitdiff
path: root/clang-tools-extra/clang-tidy/modernize/UseNullptrCheck.cpp
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2019-11-12 15:15:56 +0000
committerStephen Kelly <steveire@gmail.com>2020-05-21 22:34:37 +0100
commita72307c3a6f15badc2efb4614b212e6c5fee1ee9 (patch)
treefb968d2f3b8bccbd0b9e948fe30367957abcf2e5 /clang-tools-extra/clang-tidy/modernize/UseNullptrCheck.cpp
parentd13a50882006f45f760c214d167a7f037a666b0b (diff)
downloadllvm-a72307c3a6f15badc2efb4614b212e6c5fee1ee9.zip
llvm-a72307c3a6f15badc2efb4614b212e6c5fee1ee9.tar.gz
llvm-a72307c3a6f15badc2efb4614b212e6c5fee1ee9.tar.bz2
Set traversal explicitly where needed in clang-tidy
Reviewers: aaron.ballman Subscribers: nemanjai, kbarton, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D72530
Diffstat (limited to 'clang-tools-extra/clang-tidy/modernize/UseNullptrCheck.cpp')
-rw-r--r--clang-tools-extra/clang-tidy/modernize/UseNullptrCheck.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/clang-tools-extra/clang-tidy/modernize/UseNullptrCheck.cpp b/clang-tools-extra/clang-tidy/modernize/UseNullptrCheck.cpp
index 37e4d24..7e30c17 100644
--- a/clang-tools-extra/clang-tidy/modernize/UseNullptrCheck.cpp
+++ b/clang-tools-extra/clang-tidy/modernize/UseNullptrCheck.cpp
@@ -41,10 +41,12 @@ StatementMatcher makeCastSequenceMatcher() {
unless(hasImplicitDestinationType(qualType(substTemplateTypeParmType()))),
unless(hasSourceExpression(hasType(sugaredNullptrType()))));
- return castExpr(anyOf(ImplicitCastToNull,
- explicitCastExpr(hasDescendant(ImplicitCastToNull))),
- unless(hasAncestor(explicitCastExpr())))
- .bind(CastSequence);
+ return traverse(
+ ast_type_traits::TK_AsIs,
+ castExpr(anyOf(ImplicitCastToNull,
+ explicitCastExpr(hasDescendant(ImplicitCastToNull))),
+ unless(hasAncestor(explicitCastExpr())))
+ .bind(CastSequence));
}
bool isReplaceableRange(SourceLocation StartLoc, SourceLocation EndLoc,