[PATCH] D23204: Visit lambda capture inits from RecursiveASTVisitor::TraverseLambdaCapture().

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 17 02:44:02 PDT 2016


alexfh accepted this revision.
alexfh added a comment.
This revision is now accepted and ready to land.

LGTM with a couple of nits.


================
Comment at: unittests/Tooling/RecursiveASTVisitorTestExprVisitor.cpp:221
@@ +220,3 @@
+  }
+  {
+    DeclRefExprVisitor Visitor;
----------------
nit: Should this be two different tests for simplicity?

================
Comment at: unittests/Tooling/RecursiveASTVisitorTestExprVisitor.cpp:228
@@ +227,3 @@
+    // - Once for the DeclRefExpr for the use of "i" inside the lambda.
+    Visitor.ExpectMatch("i", 1, 24, /* Times = */ 2);
+    EXPECT_TRUE(Visitor.runOver(
----------------
nit: Remove all the spaces in `/*Times=*/2`.

================
Comment at: unittests/Tooling/RecursiveASTVisitorTestExprVisitor.cpp:239
@@ +238,3 @@
+  EXPECT_TRUE(Visitor.runOver(
+    "void f() { int i; [a = i + 1]{}; }",
+    DeclRefExprVisitor::Lang_CXX14));
----------------
So, C++14 allows you do that? Wow, TIL something new about C++ ;)


https://reviews.llvm.org/D23204





More information about the cfe-commits mailing list