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

Jonas Toth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 9 02:19:44 PST 2019


JonasToth added a comment.

In D56444#1350746 <https://reviews.llvm.org/D56444#1350746>, @sammccall wrote:

> 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&&`).


Wupsi, thats odd. I am currently not at my PC and can't fix, but it seems that it should be `"template <class T> T forward(T & A) { return static_cast<T&&>(A); }"` instead of `a&&`. If you have the time to try again, great! Otherwise I will check this evening (8:00-9:00 evening berlin timezone).

>> 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.

We can change the clang-tidy check as well. I think lambdas should be considered functionDecls, shouldnt they? WDYT @aaron.ballman ?


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