[clang] [Clang][Sema] Synthesize a memcpy body for defaulted union assignment (PR #206579)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 28 06:39:46 PDT 2026


================
@@ -11201,7 +11201,8 @@ void Sema::CheckMemaccessArguments(const CallExpr *Call,
                                 << ArgIdx << FnName << PointeeTy << 1);
         SearchNonTrivialToCopyField::diag(PointeeTy, Dest, *this);
       } else if ((BId == Builtin::BImemcpy || BId == Builtin::BImemmove) &&
-                 NonTriviallyCopyableCXXRecord && ArgIdx == 0) {
+                 NonTriviallyCopyableCXXRecord && ArgIdx == 0 &&
+                 !SuppressMemaccessCheck) {
----------------
erichkeane wrote:

There's about a million other calls to DiagRuntimeBehavior that this isn't catching, this isn't right here.

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


More information about the cfe-commits mailing list