philnik777 wrote:

> > ACK. Not a standard requirement though, is it?
> 
> Correct, it's only UB on non-trivially-copyable. My point was more about if 
> we want to be consistent with GCC or not. I don't have any strong opinion on 
> that.

I can see an argument that a user probably is doing something wrong if they 
`memset` a non-trivial type, especially since compilers are perfectly capable 
of optimizing zero-initializing loops into `memset`s. For `memcpy`/`memmove` we 
should definitely only diagnose non-trivially copyable cases, since it's quite 
a common optimization to `memcpy` trivially copyable objects.

https://github.com/llvm/llvm-project/pull/111434
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to