[clang] [DebugInfo] Ignore delegating constructors in constructor homing. (PR #218807)
David Blaikie via cfe-commits
cfe-commits at lists.llvm.org
Wed Aug 26 11:53:04 PDT 2026
================
@@ -27,6 +27,39 @@ struct E {
constexpr E(){};
} TestE;
+// Defined delegating constructor where delegated constructor is not defined
+// should not emit full debug info.
+// CHECK-DAG: !DICompositeType(tag: DW_TAG_structure_type, name: "Delegating"{{.*}}flags: DIFlagFwdDecl
+struct Delegating {
+ Delegating() : Delegating(42) {}
+ Delegating(int);
+} TestDelegating;
+
+// Defined delegating constructor where delegated constructor is defined should
+// emit full debug info.
+// CHECK-DAG: !DICompositeType(tag: DW_TAG_structure_type, name: "DelegatingToDefined"{{.*}}DIFlagTypePassByValue
+struct DelegatingToDefined {
+ DelegatingToDefined() : DelegatingToDefined(42) {}
+ DelegatingToDefined(int) {}
+} TestDelegatingToDefined;
+
+// Defined out-of-line delegating constructor where delegated constructor is
+// defined should emit full debug info.
+// CHECK-DAG: !DICompositeType(tag: DW_TAG_structure_type, name: "DelegatingOutOfLine"{{.*}}DIFlagTypePassByValue
+struct DelegatingOutOfLine {
+ DelegatingOutOfLine();
+ DelegatingOutOfLine(int) {}
+};
+DelegatingOutOfLine d;
+DelegatingOutOfLine::DelegatingOutOfLine() : DelegatingOutOfLine(42) {}
----------------
dwblaikie wrote:
Perhaps add a test case for both sides of that scenario (delegating ctor declared-but-not-defined, inline ctor that is delegated to - one version with the delegating ctor defined (type should be defined), one version without it defined (type should not be emitted))
https://github.com/llvm/llvm-project/pull/218807
More information about the cfe-commits
mailing list