summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/lambda-expressions.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-12-01 01:01:09 +0000
committerDouglas Gregor <dgregor@apple.com>2012-12-01 01:01:09 +0000
commitc401755f4660d6b42ed74d53e580e4a5f8c2ee9f (patch)
tree802ee35bbc141ea3ac9138973374bf5be3e1e9e6 /clang/test/CodeGenCXX/lambda-expressions.cpp
parent640a126d81e172d6c124120edc16039913ebf4cc (diff)
downloadbcm5719-llvm-c401755f4660d6b42ed74d53e580e4a5f8c2ee9f.tar.gz
bcm5719-llvm-c401755f4660d6b42ed74d53e580e4a5f8c2ee9f.zip
Fix the determination of whether a capture refers to an enclosing
scope when dealing with nested blocks. Fixes <rdar://problem/12778708>. llvm-svn: 169065
Diffstat (limited to 'clang/test/CodeGenCXX/lambda-expressions.cpp')
-rw-r--r--clang/test/CodeGenCXX/lambda-expressions.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/clang/test/CodeGenCXX/lambda-expressions.cpp b/clang/test/CodeGenCXX/lambda-expressions.cpp
index cee4f172a00..19195c9dd29 100644
--- a/clang/test/CodeGenCXX/lambda-expressions.cpp
+++ b/clang/test/CodeGenCXX/lambda-expressions.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10.0.0 -emit-llvm -o - %s -fexceptions -std=c++11 | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10.0.0 -fblocks -emit-llvm -o - %s -fexceptions -std=c++11 | FileCheck %s
// CHECK-NOT: @unused
auto unused = [](int i) { return i+1; };
@@ -89,3 +89,14 @@ int g() {
// CHECK-NEXT: ret i32
// CHECK: define internal void @"_ZZ1e1ES_bEN3$_4D2Ev"
+
+// <rdar://problem/12778708>
+struct XXX {};
+void nestedCapture () {
+ XXX localKey;
+ ^() {
+ [&]() {
+ ^{ XXX k = localKey; };
+ };
+ };
+}
OpenPOWER on IntegriCloud