aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Format/FormatTestComments.cpp
diff options
context:
space:
mode:
authorjkorous-apple <32549412+jkorous-apple@users.noreply.github.com>2024-02-06 16:19:46 -0800
committerGitHub <noreply@github.com>2024-02-06 16:19:46 -0800
commit2f490583c368627f552c71e340c39f2b55c0526c (patch)
tree1bd6efa82cea83932af0acb83f7d380a55df3d46 /clang/unittests/Format/FormatTestComments.cpp
parent42357df2df4977c80aba77fcab706638a121bde0 (diff)
downloadllvm-2f490583c368627f552c71e340c39f2b55c0526c.zip
llvm-2f490583c368627f552c71e340c39f2b55c0526c.tar.gz
llvm-2f490583c368627f552c71e340c39f2b55c0526c.tar.bz2
[-Wunsafe-buffer-usage] Fix debug notes for unclaimed DREs (#80787)
Debug notes for unclaimed DeclRefExpr should report any DRE of an unsafe variable that is not covered by a Fixable (i. e. fixit for the particular AST pattern isn't implemented for whatever reason). Currently not all unclaimed DeclRefExpr-s are reported which is a bug. The debug notes report only those DREs where the referred VarDecl has at least one other DeclRefExpr which is claimed (covered by a fixit). If there is an unsafe VarDecl that has exactly one DRE and the DRE isn't claimed then the debug note about missing fixit won't be emitted. That is because the debug note is emitted from within a loop over set of successfully matched FixableGadgets which by-definition is missing those DRE that are not matched at all. The new code simply iterates over all unsafe VarDecls and all of their unclaimed DREs.
Diffstat (limited to 'clang/unittests/Format/FormatTestComments.cpp')
0 files changed, 0 insertions, 0 deletions