[PATCH] D139737: [-Wunsafe-buffer-usage] Initiate Fix-it generation for local variable declarations

Ziqing Luo via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 19 13:35:44 PST 2023


ziqingluo-90 updated this revision to Diff 490648.
ziqingluo-90 added a comment.

Rebased the code w.r.t. a series of refactoring in [-Wunsafe-buffer-usage].
Added a `FixableGadget` for array subscripts of the form `DRE[*]` in the context of lvalue-to-rvalue casting.

Also did a refactoring at the place where matchers are applied:  Matchers of a `FixableGadget` and  of a `WarningGadget` cat match for the same AST node.  So they should not be put in an `anyOf` group, otherwise they can disable each other due to short-circuiting.


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

https://reviews.llvm.org/D139737

Files:
  clang/include/clang/Analysis/Analyses/UnsafeBufferUsage.h
  clang/include/clang/Analysis/Analyses/UnsafeBufferUsageGadgets.def
  clang/lib/Analysis/UnsafeBufferUsage.cpp
  clang/test/SemaCXX/warn-unsafe-buffer-usage-fixits-local-var-span.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139737.490648.patch
Type: text/x-patch
Size: 18121 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230119/3252ec10/attachment-0001.bin>


More information about the cfe-commits mailing list