[clang] [compiler-rt] [libcxx] [llvm] [clang] Warn about memset/memcpy to NonTriviallyCopyable types (PR #111434)
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 10 06:44:15 PDT 2024
================
@@ -8899,18 +8899,42 @@ void Sema::CheckMemaccessArguments(const CallExpr *Call,
<< ArgIdx << FnName << PointeeTy
<< Call->getCallee()->getSourceRange());
else if (const auto *RT = PointeeTy->getAs<RecordType>()) {
+
+ auto IsTriviallyCopyableCXXRecord = [](auto const *RT) {
----------------
AaronBallman wrote:
Actually, @erichkeane just reminded me that we have `QualType::isTriviallyCopyableType()` -- that's an even better interface to use IMO.
https://github.com/llvm/llvm-project/pull/111434
More information about the cfe-commits
mailing list