Files
llvm-project/clang/test/CodeGenCXX/dtor-local-lambda-mangle.cpp
eiytoq a8a83ec172 [Clang] Fix Itanium mangling crash for local lambda in ctor/dtor (#181068)
Fixes #176395 

Note: I need someone to help me merge this PR, since I don't have commit
access.
2026-04-09 06:14:54 -07:00

34 lines
689 B
C++

// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 -O2 -emit-llvm -o /dev/null %s
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 -O2 -disable-llvm-passes -emit-llvm -o - %s | FileCheck %s
struct E {
E();
template<typename T>
E(T t);
~E();
};
E::E() {
struct {
// CHECK-DAG: _ZTSN1EC13$_012anotherValueMUlvE_E
int anotherValue = [x = 1] { return x; }();
} obj;
}
template<typename T>
E::E(T t) {
struct {
// CHECK-DAG: _ZTSN1EC1IiEUt_UlvE_E
int anotherValue = [x = 1] { return x; }();
} obj;
}
E::~E() {
struct {
// CHECK-DAG: _ZTSN1ED13$_012anotherValueMUlvE_E
int anotherValue = [x = 2] { return x; }();
} obj;
}
E e(1);