diff options
Diffstat (limited to 'clang/test/CodeGenCXX/pr20719.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/pr20719.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/pr20719.cpp b/clang/test/CodeGenCXX/pr20719.cpp new file mode 100644 index 00000000000..208d1113584 --- /dev/null +++ b/clang/test/CodeGenCXX/pr20719.cpp @@ -0,0 +1,35 @@ +// RUN: %clang_cc1 -triple i686-windows-msvc -emit-llvm -std=c++11 -o - %s | FileCheck %s + +// Make sure that we emit H's constructor twice: once with the first lambda +// inside of 'lep' and again with the second lambda inside of 'lep'. +// CHECK-DAG: @"\01??0?$H@V<lambda_1>@??$lep@X@@YAXXZ@@@QAE@XZ" +// CHECK-DAG: @"\01??0?$H@V<lambda_2>@??$lep@X@@YAXXZ@@@QAE@XZ" + +template <typename> +struct H { + H() {} +}; + +template <typename Fx> +int K_void(const Fx &) { + H<Fx> callee; + return 0; +} +template <typename Fx> +int K_int(const Fx &) { + H<Fx> callee; + return 0; +} + +struct pair { + pair(int, int); +}; + +struct E1; + +template <typename> +void lep() { + pair x(K_void([] {}), K_int([] {})); +} + +auto z = lep<void>; |