diff options
author | Alp Toker <alp@nuanti.com> | 2014-06-26 01:42:24 +0000 |
---|---|---|
committer | Alp Toker <alp@nuanti.com> | 2014-06-26 01:42:24 +0000 |
commit | e3ad531afb410bd02662d6187a3d7c1594f0df6c (patch) | |
tree | 731e1767cd290ef7b637a8d1f270b0d3ea729159 /clang/unittests/Tooling/RecursiveASTVisitorTest.cpp | |
parent | c6f8fdb4e5fad2cc443c135b39c1051c96df9c6c (diff) | |
download | bcm5719-llvm-e3ad531afb410bd02662d6187a3d7c1594f0df6c.tar.gz bcm5719-llvm-e3ad531afb410bd02662d6187a3d7c1594f0df6c.zip |
RAV: visit copy expressions of captured variables in blocks (ObjC++11)
Patch by Mathieu Baudet.
llvm-svn: 211758
Diffstat (limited to 'clang/unittests/Tooling/RecursiveASTVisitorTest.cpp')
-rw-r--r-- | clang/unittests/Tooling/RecursiveASTVisitorTest.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/unittests/Tooling/RecursiveASTVisitorTest.cpp b/clang/unittests/Tooling/RecursiveASTVisitorTest.cpp index 6be734e6d4b..a1a93a59c79 100644 --- a/clang/unittests/Tooling/RecursiveASTVisitorTest.cpp +++ b/clang/unittests/Tooling/RecursiveASTVisitorTest.cpp @@ -561,6 +561,16 @@ TEST(RecursiveASTVisitor, HasCaptureDefaultLoc) { LambdaDefaultCaptureVisitor::Lang_CXX11)); } +TEST(RecursiveASTVisitor, VisitsCopyExprOfBlockDeclCapture) { + DeclRefExprVisitor Visitor; + Visitor.ExpectMatch("x", 3, 24); + EXPECT_TRUE(Visitor.runOver("void f(int(^)(int)); \n" + "void g() { \n" + " f([&](int x){ return x; }); \n" + "}", + DeclRefExprVisitor::Lang_OBJCXX11)); +} + // Checks for lambda classes that are not marked as implicitly-generated. // (There should be none.) class ClassVisitor : public ExpectedLocationVisitor<ClassVisitor> { |