[PATCH] D155890: [clang-tidy] Add folly::Optional to unchecked-optional-access

Carlos Galvez via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 21 11:22:50 PDT 2023


carlosgalvezp added inline comments.


================
Comment at: clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp:62
+    return N != nullptr && (isTopLevelNamespaceWithName(*N, "base") ||
+                            isTopLevelNamespaceWithName(*N, "folly"));
   }
----------------
gribozavr2 wrote:
> carlosgalvezp wrote:
> > If there's no need for `absl` here, why do we need to add `folly`?
> This is the branch for `RD.getName() == "Optional"` with a capital "O" because `base::Optional`, `folly;:Optional` are spelled with a capital "O".
> 
> Abseil provides `absl::optional` and it is handled under `RD.getName() == "optional"` together with `std::optional` above.
Got it, thanks!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D155890



More information about the cfe-commits mailing list