diff options
author | Piotr Padlewski <piotr.padlewski@gmail.com> | 2016-05-31 15:26:56 +0000 |
---|---|---|
committer | Piotr Padlewski <piotr.padlewski@gmail.com> | 2016-05-31 15:26:56 +0000 |
commit | e93a73fb7aa49d04f1109e6c3c69530ea6d81d31 (patch) | |
tree | 11aca431300988da1967aee59494d6e2b06d4eb1 /clang-tools-extra/clang-tidy/misc/SizeofContainerCheck.cpp | |
parent | cfed2bf5881597a05a1abab446b96bb8d3adb33a (diff) | |
download | bcm5719-llvm-e93a73fb7aa49d04f1109e6c3c69530ea6d81d31.tar.gz bcm5719-llvm-e93a73fb7aa49d04f1109e6c3c69530ea6d81d31.zip |
[ASTMatchers] Added ignoringParenImpCasts to has matchers
has matcher changed behaviour, and now it matches "as is" and
doesn't skip implicit and paren casts
http://reviews.llvm.org/D20801
llvm-svn: 271289
Diffstat (limited to 'clang-tools-extra/clang-tidy/misc/SizeofContainerCheck.cpp')
-rw-r--r-- | clang-tools-extra/clang-tidy/misc/SizeofContainerCheck.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang-tools-extra/clang-tidy/misc/SizeofContainerCheck.cpp b/clang-tools-extra/clang-tidy/misc/SizeofContainerCheck.cpp index d591e46181d..188d28ae2c4 100644 --- a/clang-tools-extra/clang-tidy/misc/SizeofContainerCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/SizeofContainerCheck.cpp @@ -20,12 +20,12 @@ namespace misc { void SizeofContainerCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher( expr(unless(isInTemplateInstantiation()), - expr(sizeOfExpr(has( + expr(sizeOfExpr(has(ignoringParenImpCasts( expr(hasType(hasCanonicalType(hasDeclaration(cxxRecordDecl( matchesName("^(::std::|::string)"), unless(matchesName("^::std::(bitset|array)$")), hasMethod(cxxMethodDecl(hasName("size"), isPublic(), - isConst())))))))))) + isConst()))))))))))) .bind("sizeof"), // Ignore ARRAYSIZE(<array of containers>) pattern. unless(hasAncestor(binaryOperator( |