From e831690957130234e898be38f32795f5f062695d Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Thu, 30 Apr 2015 20:51:03 +0000 Subject: [PATCH] PR22354: Add a test that we emit copy-ctors for captures in generic lambdas. The bug was fixed by r235921. llvm-svn: 236254 --- clang/test/CodeGenCXX/cxx1y-generic-lambdas.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 clang/test/CodeGenCXX/cxx1y-generic-lambdas.cpp diff --git a/clang/test/CodeGenCXX/cxx1y-generic-lambdas.cpp b/clang/test/CodeGenCXX/cxx1y-generic-lambdas.cpp new file mode 100644 index 0000000..9ab44cd --- /dev/null +++ b/clang/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); +} + -- 2.7.4