]> granicus.if.org Git - clang/commit
Make RecursiveASTVisitor visit lambda capture initialization expressions
authorMartin Bohme <mboehme@google.com>
Tue, 26 Jul 2016 15:19:10 +0000 (15:19 +0000)
committerMartin Bohme <mboehme@google.com>
Tue, 26 Jul 2016 15:19:10 +0000 (15:19 +0000)
commita00e4046e42cef7b283bf0a743a8147434ef0378
tree6e75be0d41c05f32e53b1b88705a9b8e4063e764
parent638fa18e43f75f71bdaf28da6b8307976abab8a0
Make RecursiveASTVisitor visit lambda capture initialization expressions

Summary:
Lambda capture initializations are part of the explicit source code and therefore should be visited by default but, so far, RecursiveASTVisitor does not visit them.

This appears to be an oversight. Because the lambda body needs custom handling (calling TraverseLambdaBody()), the DEF_TRAVERSE_STMT for LambdaExpr sets ShouldVisitChildren to false but then neglects to visit the lambda capture initializations. This patch adds code to visit the expressions associated with lambda capture initializations.

Reviewers: klimek

Subscribers: klimek, cfe-commits

Differential Revision: https://reviews.llvm.org/D22566

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@276755 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/AST/RecursiveASTVisitor.h
unittests/Tooling/RecursiveASTVisitorTestExprVisitor.cpp