================
@@ -66,13 +66,21 @@ void DanglingPtrDeref::checkPostCall(const CallEvent &Call,
   }
 }
 
+static std::string getRegionName(const MemRegion *Reg) {
+  // FIXME: Once the checker supports heap allocation, more region kinds
+  // should be handled to produce the correct descriptive name.
+  if (const std::string RegName = Reg->getDescriptiveName(); !RegName.empty())
----------------
isuckatcs wrote:

Nit:
```suggestion
  if (std::string RegName = Reg->getDescriptiveName(); !RegName.empty())
```
or
```suggestion
  if (const std::string &RegName = Reg->getDescriptiveName(); !RegName.empty())
```

https://github.com/llvm/llvm-project/pull/211552
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to