This is an archive of the discontinued LLVM Phabricator instance.

Make RecursiveASTVisitor visit lambda capture initialization expressions
ClosedPublic

Authored by mboehme on Jul 20 2016, 5:10 AM.

Details

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.

Diff Detail

Event Timeline

mboehme updated this revision to Diff 64665.Jul 20 2016, 5:10 AM
mboehme retitled this revision from to Make RecursiveASTVisitor visit lambda capture initialization expressions.
mboehme updated this object.
mboehme added a reviewer: klimek.
mboehme added a subscriber: cfe-commits.
klimek accepted this revision.Jul 20 2016, 5:34 AM
klimek edited edge metadata.

lg

This revision is now accepted and ready to land.Jul 20 2016, 5:34 AM
This revision was automatically updated to reflect the committed changes.

This was reverted in rL276759 because it broke modernize-loop-convert.

D22903 contains a fix for the modernize-loop-convert issue. Will re-submit this patch once D22903 has landed.