[PATCH] D151192: [clang-tidy] have bugprone-unchecked-optional-access check boost::optional usage
Giel van Schijndel via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue May 23 02:06:07 PDT 2023
muggenhor created this revision.
Herald added subscribers: carlosgalvezp, xazax.hun.
Herald added a reviewer: NoQ.
Herald added a project: All.
muggenhor requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D151192
Files:
clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp
Index: clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp
===================================================================
--- clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp
+++ clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp
@@ -50,7 +50,8 @@
if (RD.getName() == "optional") {
if (const auto *N = dyn_cast_or_null<NamespaceDecl>(RD.getDeclContext()))
- return N->isStdNamespace() || isTopLevelNamespaceWithName(*N, "absl");
+ return N->isStdNamespace() || isTopLevelNamespaceWithName(*N, "absl") ||
+ isTopLevelNamespaceWithName(*N, "boost");
return false;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151192.524618.patch
Type: text/x-patch
Size: 678 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230523/b76c93b3/attachment-0001.bin>
More information about the cfe-commits
mailing list