vsavchenko added inline comments.

================
Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:254-257
+  const auto *Decl = Call.getDecl();
+  if (!Decl)
+    return false;
+  if (!Decl->getDeclContext()->isStdNamespace())
----------------
I think you can have a separate function:
```
bool isStdFunctionCall(const CallEvent &Call) {
  return Call.getDecl() && Call.getDecl()->getDeclContext()->isStdNamespace();
}
```
and then use it like this:
```
if (Call.getNumArgs() != 2 || !isStdFunctionCall(Call))
  return false;
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106296

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to