From: Richard Smith Date: Thu, 30 Apr 2015 20:51:03 +0000 (+0000) Subject: PR22354: Add a test that we emit copy-ctors for captures in generic lambdas. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4e7797e6e1aecf271420a28a3e246d0a652c6a84;p=clang PR22354: Add a test that we emit copy-ctors for captures in generic lambdas. The bug was fixed by r235921. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@236254 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/CodeGenCXX/cxx1y-generic-lambdas.cpp b/test/CodeGenCXX/cxx1y-generic-lambdas.cpp new file mode 100644 index 0000000000..9ab44cd477 --- /dev/null +++ b/test/CodeGenCXX/cxx1y-generic-lambdas.cpp @@ -0,0 +1,13 @@ +// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -o - %s -std=c++14 | FileCheck %s + +template 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 cc; + [cc](auto){}(1); +} +