================ @@ -241,10 +241,14 @@ BlockInCriticalSectionChecker::checkDescriptorMatch(const CallEvent &Call, return std::nullopt; } -static const MemRegion *skipBaseClassRegion(const MemRegion *Reg) { - while (const auto *BaseClassRegion = dyn_cast<CXXBaseObjectRegion>(Reg)) { +static const MemRegion *skipStdBaseClassRegion(const MemRegion *Reg) { + do { + assert(Reg); + const auto *BaseClassRegion = dyn_cast<CXXBaseObjectRegion>(Reg); + if (!BaseClassRegion || !BaseClassRegion->getDecl()->isInStdNamespace()) ---------------- steakhal wrote:
FYI `isInStdNamespace` only works if the decl is exactly within std. Any nested namespaces beyond std, or class scopes are rejected even if their parents reside within std. Have a look at `CallEvent.cpp:isWithinStdNamespace()`. If you think it's what we should use here, we could hoist that function into some utility header and use it. https://github.com/llvm/llvm-project/pull/106240 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits