summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/misc/SizeofContainerCheck.cpp
diff options
context:
space:
mode:
authorPiotr Padlewski <piotr.padlewski@gmail.com>2016-05-31 15:26:56 +0000
committerPiotr Padlewski <piotr.padlewski@gmail.com>2016-05-31 15:26:56 +0000
commite93a73fb7aa49d04f1109e6c3c69530ea6d81d31 (patch)
tree11aca431300988da1967aee59494d6e2b06d4eb1 /clang-tools-extra/clang-tidy/misc/SizeofContainerCheck.cpp
parentcfed2bf5881597a05a1abab446b96bb8d3adb33a (diff)
downloadbcm5719-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.cpp4
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(
OpenPOWER on IntegriCloud