summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/cxx1y-init-captures.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-09-28 04:31:26 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-09-28 04:31:26 +0000
commit39edfeb34b0b0b8033179e35cf13cd5d95d56fa8 (patch)
treeb1d17574e94fbc198ecfb8447fc1f1962a8aea64 /test/CodeGenCXX/cxx1y-init-captures.cpp
parent04fa7a33279808dc3e5117c41b5f84c40eeb7362 (diff)
Switch from putting init capture VarDecls in the surrounding DeclContext to
putting them in the call operator's DeclContext. This better matches the language wording and avoids some cases where code gets confused by them for namespace-scope lambdas and the like. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191606 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/cxx1y-init-captures.cpp')
-rw-r--r--test/CodeGenCXX/cxx1y-init-captures.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/CodeGenCXX/cxx1y-init-captures.cpp b/test/CodeGenCXX/cxx1y-init-captures.cpp
index 6258cda3b0..a60269f3b1 100644
--- a/test/CodeGenCXX/cxx1y-init-captures.cpp
+++ b/test/CodeGenCXX/cxx1y-init-captures.cpp
@@ -94,5 +94,9 @@ int h(int a) {
} ();
}
+// Ensure we can emit code for init-captures in global lambdas too.
+auto global_lambda = [a = 0] () mutable { return ++a; };
+int get_incremented() { return global_lambda(); }
+
// CHECK-LABEL: define internal void @"_ZZ1fvEN3$_0D2Ev"(
// CHECK: call void @_ZN1SD1Ev(