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

Stephen Kelly via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 9 07:33:36 PST 2019


steveire added a comment.

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

> In D56444#1351130 <https://reviews.llvm.org/D56444#1351130>, @steveire wrote:
>
> > In D56444#1351125 <https://reviews.llvm.org/D56444#1351125>, @aaron.ballman wrote:
> >
> > > if the location isn't somewhere in user code, then don't consider the node or its children for traversal. However, that may be insufficient and equally as mysterious behavior.
> >
> >
> > That is exactly what I've implemented. I skip invisible nodes in matching and dumping: http://ec2-18-191-7-3.us-east-2.compute.amazonaws.com:10240/z/EuYjAn
>
>
> So what happens when someone asks about the parent of an invisible node?
>
> e.g. `match(hasParent(decl().bind("parent")), X, Ctx)` where X is the `operator()` function of a lambda class. (This is basically the case in the bug that this patch fixes)


Assuming that whether to skip invisible nodes is part of the `Ctx`, the `X` would simply not be in context, just like if the `X` were not in the `TraversalScope` of the `Ctx`.


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