From 43c3f28c2328ebc96f356eb002d1bc8ff86c6324 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. llvm-svn: 150987 --- clang/test/CodeGenCXX/lambda-expressions.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'clang/test/CodeGenCXX/lambda-expressions.cpp') diff --git a/clang/test/CodeGenCXX/lambda-expressions.cpp b/clang/test/CodeGenCXX/lambda-expressions.cpp index 6f0fa87bb14..5a68e893d71 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 -- cgit v1.2.3