[PATCH] D56444: [AST] RecursiveASTVisitor visits lambda classes when implicit visitation is on.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 9 00:11:48 PST 2019


sammccall added a subscriber: klimek.
sammccall added a comment.

In D56444#1350252 <https://reviews.llvm.org/D56444#1350252>, @JonasToth wrote:

> I still see the unit-test crashing for `ExprMutAnalyzer` (just apply the last two tests https://github.com/JonasToth/clang/blob/fix_crash/unittests/Analysis/ExprMutationAnalyzerTest.cpp and run `check-clang-unit`)


The `ReproduceFailure11` test passes for me, and the `ReproduceFailureMinimal` fails to compile (`a&&`).

> The clang-tidy check does not crash anymore, but `readability-function-size` regresses. It probably doesn't properly count for lambdas anymore.

Rather, it previously **didn't** count lambda bodies as functions (because `functionDecl()` didn't include them), and now it does :-)
I think counting them is better behavior, but I've modified the matcher to preserve the behavior for now.

@klimek: would it be better to preserve the odd behavior of the `functionDecl()` matcher, and add a new `functionOrLambdaDecl()`? It seems too surprising to me.


Repository:
  rC Clang

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

https://reviews.llvm.org/D56444





More information about the cfe-commits mailing list