[clang] Fix false positive of [[clang::require_explicit_initialization]] on copy/move constructors (PR #126553)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 10 09:56:24 PST 2025


================
@@ -1582,7 +1582,21 @@ void aggregate() {
       F("___"),
       F("____")
   };
-  (void)ctors;
+
+  struct Copy {
+    Embed e;
+    EmbedDerived ed;
+    F f;
+    Copy(const Copy &c) : e(c.e), ed(c.ed), f(c.f) {} // no-error
----------------
AaronBallman wrote:

Can you add test coverage for a move constructor as well?

https://github.com/llvm/llvm-project/pull/126553


More information about the cfe-commits mailing list