diff options
author | Sam McCall <sam.mccall@gmail.com> | 2019-01-14 10:40:41 +0000 |
---|---|---|
committer | Sam McCall <sam.mccall@gmail.com> | 2019-01-14 10:40:41 +0000 |
commit | b1f1d47cbd57791ea34855f77213a1a8087044af (patch) | |
tree | b84d78a61205fcf140c19e894754b834749ded78 /clang-tidy/readability | |
parent | 477aed9820258d4cef23745fa1b8274b6363da24 (diff) |
[clang-tidy] update FunctionSizeCheck for D56444
Reviewers: JonasToth, aaron.ballman
Subscribers: xazax.hun, cfe-commits
Differential Revision: https://reviews.llvm.org/D56552
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@351048 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'clang-tidy/readability')
-rw-r--r-- | clang-tidy/readability/FunctionSizeCheck.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/clang-tidy/readability/FunctionSizeCheck.cpp b/clang-tidy/readability/FunctionSizeCheck.cpp index 9547afb8..4d91f2e7 100644 --- a/clang-tidy/readability/FunctionSizeCheck.cpp +++ b/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) { |