[clang] [clang-tools-extra] [clang-tidy] `bugprone-unchecked-optional-access`: handle inheritance from `BloombergLP::bslstl::Optional_Base` to prevent false-positives for allocator-aware BDE types (PR #168863)

Valentyn Yukhymenko via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 15 08:39:12 PST 2025


================
@@ -78,6 +78,12 @@ static bool hasOptionalClassName(const CXXRecordDecl &RD) {
                             isFullyQualifiedNamespaceEqualTo(*N, "folly"));
   }
 
+  if (RD.getName() == "Optional_Base") {
----------------
BaLiKfromUA wrote:

Anyway, I applied your suggestion and added few tests for `bsl::optional` copy constructions

https://github.com/llvm/llvm-project/pull/168863


More information about the cfe-commits mailing list