summaryrefslogtreecommitdiffstats
path: root/clang/test
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
commit75e3f695fb5b3852a3b6d4ea5fa4546c82a5cfb8 (patch)
treed4de7ae381755ad932fe28a78a4cf52b471aaac5 /clang/test
parentbb13c9a49d08b56b9a8f04bd76ad3a7972bcc478 (diff)
downloadbcm5719-llvm-75e3f695fb5b3852a3b6d4ea5fa4546c82a5cfb8.tar.gz
bcm5719-llvm-75e3f695fb5b3852a3b6d4ea5fa4546c82a5cfb8.zip
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. llvm-svn: 191606
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/CodeGenCXX/cxx1y-init-captures.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/cxx1y-init-captures.cpp b/clang/test/CodeGenCXX/cxx1y-init-captures.cpp
index 6258cda3b0e..a60269f3b18 100644
--- a/clang/test/CodeGenCXX/cxx1y-init-captures.cpp
+++ b/clang/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(
OpenPOWER on IntegriCloud