================
@@ -15005,6 +15015,14 @@ buildMemcpyForAssignmentOp(Sema &S, SourceLocation 
Loc, QualType T,
   Expr *CallArgs[] = {
     To, From, IntegerLiteral::Create(S.Context, Size, SizeType, Loc)
   };
+
+  // The synthesized union whole-object copy is a memcpy of a possibly
+  // non-trivially-copyable record, which is correct here; skip the memaccess
+  // warning across just this call rather than casting the arguments to void*.
+  std::optional<llvm::SaveAndRestore<bool>> DisableMemaccessCheck;
----------------
erichkeane wrote:

This is a SUPER odd way to use this... 

Why isn't this whole area just `llvm::SaveAndRestore<boo> 
DisableMemaccessCheck(S.SuppressMemaccessCheck, SuppressMemaccessWarning)`? 

https://github.com/llvm/llvm-project/pull/206579
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to