Make sure that we set up the right declaration contexts when creating
and introducing the lambda closure type and its function call
operator. Previously, we assumed that the lambda closure type would
land directly in the current context, and not some parent context (as
occurs with linkage specifications). Thanks to Richard for the test case.
llvm-svn: 150987
diff --git a/clang/test/CodeGenCXX/lambda-expressions.cpp b/clang/test/CodeGenCXX/lambda-expressions.cpp
index 6f0fa87..5a68e89 100644
--- a/clang/test/CodeGenCXX/lambda-expressions.cpp
+++ b/clang/test/CodeGenCXX/lambda-expressions.cpp
@@ -3,6 +3,9 @@
// CHECK: @var = internal global
auto var = [](int i) { return i+1; };
+// CHECK: @cvar = global
+extern "C" auto cvar = []{};
+
int a() { return []{ return 1; }(); }
// CHECK: define i32 @_Z1av
// CHECK: call i32 @_ZZ1avENKUlvE_clEv