================
@@ -0,0 +1,32 @@
+// 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
+// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 -O2 
-disable-llvm-passes -fclang-abi-compat=18 -emit-llvm -o - %s | FileCheck %s
+
+struct E {
+  E();
+  ~E();
+};
+
+E::E() {
+  struct {
+    int anotherValue = [] { return 1; }();
+  } obj;
+}
+
+E::~E() {
+  struct {
+    int anotherValue = [] { return 2; }();
+  } obj;
+}
+
+// CHECK-LABEL: define internal void @"_ZZN1EC1EvEN3$_0C2Ev"
+// CHECK: store i32 %{{.*}}, ptr %anotherValue, align 4, !tbaa 
![[CTOR_ACCESS:[0-9]+]]
+
+// CHECK-LABEL: define internal void @"_ZZN1ED1EvEN3$_0C2Ev"
+// CHECK: store i32 %{{.*}}, ptr %anotherValue, align 4, !tbaa 
![[DTOR_ACCESS:[0-9]+]]
+
+// CHECK: ![[CTOR_ACCESS]] = !{![[CTOR_TYPE:[0-9]+]], ![[INT:[0-9]+]], i64 0}
+// CHECK: ![[CTOR_TYPE]] = !{!"_ZTSZN1EC1EvE3$_0", ![[INT]], i64 0}
----------------
efriedma-quic wrote:

Still not the right name... in fact, the name you want doesn't even show up in 
the output for the current testcase, I think.

Try:

```
struct E {
  E();
};

E::E() {
  struct {
    int anotherValue = [x=1] { return x; }();
  } obj;
}
```

https://github.com/llvm/llvm-project/pull/181068
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to