[PATCH] D156255: [clang-tidy] Update unchecked-optional-access-check to use convenience function for diagnosing `FunctionDecl`s.
Martin Böhme via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 26 00:57:34 PDT 2023
mboehme accepted this revision.
mboehme added a comment.
This revision is now accepted and ready to land.
Note this appears to have clang-format errors
================
Comment at: clang-tools-extra/clang-tidy/bugprone/UncheckedOptionalAccessCheck.cpp:58-63
+ if (llvm::Expected<std::vector<SourceLocation>> Errors =
+ dataflow::diagnoseFunction<UncheckedOptionalAccessModel,
+ SourceLocation>(*FuncDecl, *Result.Context,
+ Diagnoser))
for (const SourceLocation &Loc : *Errors)
diag(Loc, "unchecked access to optional value");
----------------
`Errors` could be confused with the error that is present inside the `Expected`.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D156255/new/
https://reviews.llvm.org/D156255
More information about the cfe-commits
mailing list