]> granicus.if.org Git - clang/commit
Make RecursiveASTVisitor visit lambda capture initialization expressions
authorMartin Bohme <mboehme@google.com>
Mon, 1 Aug 2016 12:15:46 +0000 (12:15 +0000)
committerMartin Bohme <mboehme@google.com>
Mon, 1 Aug 2016 12:15:46 +0000 (12:15 +0000)
commita70f96e037411959d26711a7648342e6f9700afb
tree3b0479c0940cf055fd7068389fd03b4abc8086a4
parenta91c9fbcf226556a981f9faefdaf2575c5e057fc
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: cfe-commits

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

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