hokein added a comment.

In D55437#1333145 <https://reviews.llvm.org/D55437#1333145>, @ilya-biryukov 
wrote:

> Update after investigating with @hokein offline: the `RecursiveASTVisitor` 
> has custom code to visit lambda parameters and return type, but it fallback 
> to visiting typelocs when both parameters and a return type are specified. 
> Unfortunately this fallback does not work when `shouldWalkTypeLocs()` is set 
> to false, which is the case for our visitor out here.
>  It seems reasonable to always visit parameters and return type, rather than 
> relying on traversing the full type-loc of the lamda's function type.


Thanks! After taking a look at the code closely, it turns out `VisitTypeLoc` 
callback gets called when `shouldWalkTypeOfTypeLocs` is set to false, 
`shouldWalkTypeOfTypeLocs` just controls whether we visit the **type** itself, 
**type loc** is always visited.

Unifying code paths of `RecursiveASTVisitor` seems fine to me, and also 
simplifies the code of client side, separated in D55820 
<https://reviews.llvm.org/D55820>.


Repository:
  rC Clang

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

https://reviews.llvm.org/D55437



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to