]> granicus.if.org Git - clang/commit
Visit lambda capture inits from RecursiveASTVisitor::TraverseLambdaCapture().
authorMartin Bohme <mboehme@google.com>
Wed, 17 Aug 2016 14:59:53 +0000 (14:59 +0000)
committerMartin Bohme <mboehme@google.com>
Wed, 17 Aug 2016 14:59:53 +0000 (14:59 +0000)
commit70e216b530344da3d450434455198f28aee852b0
treeeae5d17e4348238a5ac2572d581c601e0c750382
parent301bc621b5f774ca2998f9804730ee5d15846c8a
Visit lambda capture inits from RecursiveASTVisitor::TraverseLambdaCapture().

Summary:
rL277342 made RecursiveASTVisitor visit lambda capture initialization
expressions (these are the Exprs in LambdaExpr::capture_inits()).

jdennett identified two issues with rL277342 (see comments there for details):

- It visits initialization expressions for implicit lambda captures, even if
  shouldVisitImplicitCode() returns false.

- It visits initialization expressions for init captures twice (because these
  were already traveresed in TraverseLambdaCapture() before rL277342)

This patch fixes these issues and moves the code for traversing initialization
expressions into TraverseLambdaCapture().

This patch also makes two changes required for the tests:

- It adds Lang_CXX14 to the Language enum in TestVisitor.

- It adds a parameter to ExpectedLocationVisitor::ExpectMatch() that specifies
  the number of times a match is expected to be seen.

Reviewers: klimek, jdennett, alexfh

Subscribers: cfe-commits

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

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