sammccall created this revision. sammccall added reviewers: JonasToth, aaron.ballman. Herald added subscribers: cfe-commits, xazax.hun.
Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D56552 Files: clang-tidy/readability/FunctionSizeCheck.cpp Index: clang-tidy/readability/FunctionSizeCheck.cpp =================================================================== --- clang-tidy/readability/FunctionSizeCheck.cpp +++ clang-tidy/readability/FunctionSizeCheck.cpp @@ -145,7 +145,12 @@ } 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) {
Index: clang-tidy/readability/FunctionSizeCheck.cpp =================================================================== --- clang-tidy/readability/FunctionSizeCheck.cpp +++ clang-tidy/readability/FunctionSizeCheck.cpp @@ -145,7 +145,12 @@ } 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) {
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits