mirror of
https://github.com/llvm/llvm-project.git
synced 2025-05-02 23:56:05 +00:00

The Itanium ABI will give out the same mangling number for two different lambdas if their call operators have different types. The MS ABI cannot do the same because it does not mangle the return type into it's lambdas. This fixes PR20719. llvm-svn: 216259
36 lines
708 B
C++
36 lines
708 B
C++
// 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>;
|