================
@@ -269,6 +293,35 @@ struct DCNE : KW {
// CHECK-FIXES: DCNE() noexcept = default;
};
+// Delegating constructor with zero-init of an array of class type.
+struct DCNA {
+ DCNA() : entries() {}
+ // defaulting would remove the zero-init of entries.
+ non_empty entries[32];
+};
+
+// Zero-init of an array of scalars.
+struct DCNS {
+ DCNS() : buf() {}
+ // defaulting would remove the zero-init of buf.
+ unsigned buf[8];
+};
+
+// Same for a plain scalar member.
+struct DCNSM {
+ DCNSM() : x() {}
+ // defaulting would remove the zero-init of x.
+ int x;
----------------
zwuis wrote:
Can you add tests with `int x = 1;`?
https://github.com/llvm/llvm-project/pull/232363
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits