aboutsummaryrefslogtreecommitdiff
path: root/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
commit464a01a67c2cf7c42c4d15f687f6b9a622468783 (patch)
tree7aec7ccf9507688b8ef2979687fc63e1adb7f575 /test/CodeGenCXX/lambda-expressions.cpp
parent6e6330c07a42ace74637d0ad7356a2fa20de81ec (diff)
Fix the determination of whether a capture refers to an enclosing
scope when dealing with nested blocks. Fixes <rdar://problem/12778708>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169065 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/lambda-expressions.cpp')
-rw-r--r--test/CodeGenCXX/lambda-expressions.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/test/CodeGenCXX/lambda-expressions.cpp b/test/CodeGenCXX/lambda-expressions.cpp
index cee4f172a0..19195c9dd2 100644
--- a/test/CodeGenCXX/lambda-expressions.cpp
+++ b/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; };
+ };
+ };
+}