[clang] [CIR] Add support for delegating constructors with VTT args (PR #156970)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 5 10:51:43 PDT 2025
================
@@ -70,3 +70,266 @@ DelegatingWithZeroing::DelegatingWithZeroing(int) : DelegatingWithZeroing() {}
// OGCG: store i32 %[[I_ARG]], ptr %[[I_ADDR]]
// OGCG: %[[THIS:.*]] = load ptr, ptr %[[THIS_ADDR]]
// OGCG: call void @llvm.memset.p0.i64(ptr align 4 %[[THIS]], i8 0, i64 4, i1 false)
+
+void other();
+
+class Base {
+public:
+ Base() { squawk(); }
+
+ virtual void squawk();
+};
+
+class Derived : public virtual Base {
+public:
+ Derived();
+ Derived(const void *inVoid);
+
+ virtual void squawk();
+};
+
+Derived::Derived() : Derived(nullptr) { other(); }
+Derived::Derived(const void *inVoid) { squawk(); }
+
+// Note: OGCG emits the constructors in a different order.
----------------
erichkeane wrote:
Ah! Yikes, ok, sorry for the digression. I though that was how DAG worked :( Thank you for spending time on it, and sorry again.
https://github.com/llvm/llvm-project/pull/156970
More information about the cfe-commits
mailing list