[PATCH] D138318: [-Wunsafe-buffer-usage] Improve pointer match pattern

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 30 09:51:34 PST 2022


aaron.ballman added inline comments.


================
Comment at: clang/lib/Analysis/UnsafeBufferUsage.cpp:31
+  return anyOf(
+    hasType(pointerType()),
+    hasType(autoType(
----------------
I shudder to ask this question, but ... pointer to member types?


================
Comment at: clang/lib/Analysis/UnsafeBufferUsage.cpp:35
+    // DecayedType, e.g., array type in formal parameter decl
+    hasType(decayedType(hasDecayedType(pointerType()))),
+    // ElaboratedType, e.g., typedef
----------------
hmmm, do you need to check `hasDecayedType(pointerType())`? What decay type *isn't* a pointer type?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138318/new/

https://reviews.llvm.org/D138318



More information about the cfe-commits mailing list