aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam McCall <sam.mccall@gmail.com>2019-01-14 10:40:41 +0000
committerSam McCall <sam.mccall@gmail.com>2019-01-14 10:40:41 +0000
commitd37be4b7797fa5766df77a40d883afcdbc18fc45 (patch)
treed1481a9c155ce757db85426121bd49d083d4a05c /clang-tools-extra
parent[AST] RecursiveASTVisitor visits lambda classes when implicit visitation is on. (diff)
downloadllvm-project-d37be4b7797fa5766df77a40d883afcdbc18fc45.tar.gz
llvm-project-d37be4b7797fa5766df77a40d883afcdbc18fc45.tar.bz2
llvm-project-d37be4b7797fa5766df77a40d883afcdbc18fc45.zip
[clang-tidy] update FunctionSizeCheck for D56444
Reviewers: JonasToth, aaron.ballman Subscribers: xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D56552 llvm-svn: 351048
Diffstat (limited to 'clang-tools-extra')
-rw-r--r--clang-tools-extra/clang-tidy/readability/FunctionSizeCheck.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/clang-tools-extra/clang-tidy/readability/FunctionSizeCheck.cpp b/clang-tools-extra/clang-tidy/readability/FunctionSizeCheck.cpp
index 9547afb89051..4d91f2e78775 100644
--- a/clang-tools-extra/clang-tidy/readability/FunctionSizeCheck.cpp
+++ b/clang-tools-extra/clang-tidy/readability/FunctionSizeCheck.cpp
@@ -145,7 +145,12 @@ void FunctionSizeCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) {
}
void FunctionSizeCheck::registerMatchers(MatchFinder *Finder) {
- Finder->addMatcher(functionDecl(unless(isInstantiated())).bind("func"), this);
+ // Lambdas ignored - historically considered part of enclosing function.
+ // FIXME: include them instead? Top-level lambdas are currently never counted.
+ Finder->addMatcher(functionDecl(unless(isInstantiated()),
+ unless(cxxMethodDecl(ofClass(isLambda()))))
+ .bind("func"),
+ this);
}
void FunctionSizeCheck::check(const MatchFinder::MatchResult &Result) {