[PATCH] D56552: [clang-tidy] update FunctionSizeCheck for D56444

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 14 02:44:44 PST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rCTE351048: [clang-tidy] update FunctionSizeCheck for D56444 (authored by sammccall, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D56552?vs=181082&id=181520#toc

Repository:
  rCTE Clang Tools Extra

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56552/new/

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) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56552.181520.patch
Type: text/x-patch
Size: 837 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190114/dd043853/attachment.bin>


More information about the cfe-commits mailing list