================
@@ -8900,7 +8900,8 @@ void Sema::CheckMemaccessArguments(const CallExpr *Call,
           << Call->getCallee()->getSourceRange());
     else if (const auto *RT = PointeeTy->getAs<RecordType>()) {
 
-      bool IsTriviallyCopyableCXXRecord =
+      bool MayBeTriviallyCopyableCXXRecord =
+          RT->isIncompleteType() ||
----------------
AaronBallman wrote:

Trivial copyability is about whether you can copy the object itself (aka, its 
members), and you can't create an object of incomplete class type or which 
contains an object of incomplete class type. So a pointer to an incomplete type 
is fine in that regard; it's just a pointer, you're not dereferencing it. 
However, for this diagnostic, `memcpy` and friends are touching the bytes of 
the object (so it's a dereference, effectively), and passing a pointer to an 
incomplete type means those are touching bytes of an unknown type which may be 
completed later.

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

Reply via email to