From fa07ab57eb565b4a00712adcefb29d96b445bfcd Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Mon, 20 Feb 2012 20:47:06 +0000 Subject: 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150987 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGenCXX/lambda-expressions.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test/CodeGenCXX/lambda-expressions.cpp') diff --git a/test/CodeGenCXX/lambda-expressions.cpp b/test/CodeGenCXX/lambda-expressions.cpp index 6f0fa87bb1..5a68e893d7 100644 --- a/test/CodeGenCXX/lambda-expressions.cpp +++ b/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 -- cgit v1.2.3-70-g09d2