[clang] Warning for unsafe invocation of span::data (PR #75650)

Malavika Samak via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 15 15:33:40 PST 2023


================
@@ -721,6 +721,33 @@ class UnsafeBufferUsageAttrGadget : public WarningGadget {
   DeclUseList getClaimedVarUseSites() const override { return {}; }
 };
 
+// Warning gadget for unsafe invocation of span::data method.
+// Triggers when the pointer returned by the invocation is immediately
+// cast to a larger type.
+
+class DataInvocationGadget : public WarningGadget {
+  constexpr static const char *const OpTag = "data_invocation_expr";
----------------
malavikasamak wrote:

Thank you. Will fix this.

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


More information about the cfe-commits mailing list