[clang] Thread Safety Analysis: Check managed capabilities of returned scoped capability (PR #131831)

Aaron Puchert via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 19 09:14:35 PDT 2025


================
@@ -2041,15 +2042,16 @@ void BuildLockset::handleCall(const Expr *Exp, const NamedDecl *D,
         if (!a.has_value()) {
           Analyzer->Handler.handleExpectFewerUnderlyingMutexes(
               Exp->getExprLoc(), D->getLocation(), Scope->toString(),
-              b.value().getKind(), b.value().toString());
+              b.value().getKind(), b.value().toString(), true);
----------------
aaronpuchert wrote:

Probably makes sense to add comments. These can be [checked](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/argument-comment.html).
```suggestion
              b.value().getKind(), b.value().toString(), /*ForParam=*/true);
```
Same below.

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


More information about the cfe-commits mailing list