[clang] [clang] Move warning about memset/memcpy to NonTriviallyCopyable type… (PR #117387)

via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 25 02:11:16 PST 2024


================
@@ -683,11 +683,13 @@ def SizeofArrayDecay : DiagGroup<"sizeof-array-decay">;
 def SizeofPointerMemaccess : DiagGroup<"sizeof-pointer-memaccess">;
 def MemsetTransposedArgs : DiagGroup<"memset-transposed-args">;
 def DynamicClassMemaccess : DiagGroup<"dynamic-class-memaccess">;
-def NonTrivialMemaccess : DiagGroup<"nontrivial-memaccess">;
+def NonTrivialMemcall : DiagGroup<"nontrivial-memcall">;
+def NonTrivialMemaccess : DiagGroup<"nontrivial-memaccess", [NonTrivialMemcall]>;
 def SuspiciousBzero : DiagGroup<"suspicious-bzero">;
 def SuspiciousMemaccess : DiagGroup<"suspicious-memaccess",
   [SizeofPointerMemaccess, DynamicClassMemaccess,
-   NonTrivialMemaccess, MemsetTransposedArgs, SuspiciousBzero]>;
+   NonTrivialMemaccess, NonTrivialMemcall, MemsetTransposedArgs,
----------------
zmodem wrote:

Hmm, do you need to include NonTrivialMemcall here explicitly? Wouldn't it be transitively included already, because NonTrivialMemaccess includes NonTrivialMemcall?

https://github.com/llvm/llvm-project/pull/117387


More information about the cfe-commits mailing list