llvm
8b7dd15a - Fix memcpy-operator= generation with restrict parameters. (#194906)

Commit
33 days ago
Fix memcpy-operator= generation with restrict parameters. (#194906) The below issue (and #63884) both report that we reject (and also assert, because the memcpy failed) the memcpy we're generating for a restrict field of a type with an implicit copy constructor. First, we shouldn't be rejecting it this late, IF we wanted to reject it (I contend we do not), we should do it at the same time we reject const-members/make this a deleted operator. Second, of course we shouldn't fail. This patch NOW works by just having us skip the premature 'memcpy' optimization here. In the end, the memcpy is generally skipped by `CodeGenFunction::EmitCXXMemberOrOperatorMemberCallExpr` in the example (as this is a trivial type), but this reverts it to using a 'for' loop for restrict, as it does for const, and volatile qualified values. We perhaps might think about doing this for address-spaces/ptr-auth, but at the moment, this fixes restrict version. Fixes: #37979
Author
Parents
Loading