summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/readability/ContainerSizeEmptyCheck.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/clang-tidy/readability/ContainerSizeEmptyCheck.cpp')
-rw-r--r--clang-tools-extra/clang-tidy/readability/ContainerSizeEmptyCheck.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang-tools-extra/clang-tidy/readability/ContainerSizeEmptyCheck.cpp b/clang-tools-extra/clang-tidy/readability/ContainerSizeEmptyCheck.cpp
index 79e4061c8c3..665d1dbe349 100644
--- a/clang-tools-extra/clang-tidy/readability/ContainerSizeEmptyCheck.cpp
+++ b/clang-tools-extra/clang-tidy/readability/ContainerSizeEmptyCheck.cpp
@@ -58,7 +58,9 @@ void ContainerSizeEmptyCheck::registerMatchers(MatchFinder *Finder) {
hasType(pointsTo(ValidContainer)),
hasType(references(ValidContainer))))
.bind("STLObject")),
- callee(cxxMethodDecl(hasName("size"))), WrongUse)
+ callee(cxxMethodDecl(hasName("size"))), WrongUse,
+ unless(hasAncestor(cxxMethodDecl(
+ ofClass(equalsBoundNode("container"))))))
.bind("SizeCallExpr"),
this);
}
OpenPOWER on IntegriCloud