]> granicus.if.org Git - clang/commitdiff
PR22354: Add a test that we emit copy-ctors for captures in generic lambdas.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 30 Apr 2015 20:51:03 +0000 (20:51 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 30 Apr 2015 20:51:03 +0000 (20:51 +0000)
The bug was fixed by r235921.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@236254 91177308-0d34-0410-b5e6-96231b3b80d8

test/CodeGenCXX/cxx1y-generic-lambdas.cpp [new file with mode: 0644]

diff --git a/test/CodeGenCXX/cxx1y-generic-lambdas.cpp b/test/CodeGenCXX/cxx1y-generic-lambdas.cpp
new file mode 100644 (file)
index 0000000..9ab44cd
--- /dev/null
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -o - %s -std=c++14 | FileCheck %s
+
+template<typename> struct custom_copy_ctor {
+  custom_copy_ctor() = default;
+  custom_copy_ctor(custom_copy_ctor const &) {}
+};
+
+// CHECK: define {{.*}} @_ZN16custom_copy_ctorIvEC2ERKS0_(
+void pr22354() {
+  custom_copy_ctor<void> cc;
+  [cc](auto){}(1);
+}
+