aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenCXX/mangle-lambdas.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGenCXX/mangle-lambdas.cpp')
-rw-r--r--test/CodeGenCXX/mangle-lambdas.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/CodeGenCXX/mangle-lambdas.cpp b/test/CodeGenCXX/mangle-lambdas.cpp
index e8bd6ec47b..cc53b01057 100644
--- a/test/CodeGenCXX/mangle-lambdas.cpp
+++ b/test/CodeGenCXX/mangle-lambdas.cpp
@@ -150,6 +150,8 @@ void use_func_template() {
func_template<int>();
}
+// CHECK: define linkonce_odr void @_Z1fIZZNK23TestNestedInstantiationclEvENKUlvE_clEvEUlvE_EvT_
+
struct Members {
int x = [] { return 1; }() + [] { return 2; }();
int y = [] { return 3; }();
@@ -165,6 +167,20 @@ void test_Members() {
// CHECK: ret void
}
+template<typename P> void f(P) { }
+
+struct TestNestedInstantiation {
+ void operator()() const {
+ []() -> void {
+ return f([]{});
+ }();
+ }
+};
+
+void test_NestedInstantiation() {
+ TestNestedInstantiation()();
+}
+
// Check the linkage of the lambdas used in test_Members.
// CHECK: define linkonce_odr i32 @_ZNK7Members1xMUlvE_clEv
// CHECK: ret i32 1