42 const MatchFinder::MatchResult &Result) {
43 if (Result.SourceManager->getDiagnostics().hasUncompilableErrorOccurred())
46 const auto *
FuncDecl = Result.Nodes.getNodeAs<FunctionDecl>(
FuncID);
50 UncheckedStatusOrAccessDiagnoser Diagnoser;
51 if (llvm::Expected<llvm::SmallVector<SourceLocation>> Locs =
52 dataflow::diagnoseFunction<UncheckedStatusOrAccessModel,
53 SourceLocation>(*
FuncDecl, *Result.Context,
55 for (
const SourceLocation &Loc : *Locs)
56 diag(Loc,
"unchecked access to 'absl::StatusOr' value");
58 llvm::consumeError(Locs.takeError());