[llvm] [LLVM][Coverage][Unittest] Fix dangling reference in unittest (PR #147118)

Ellis Hoag via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 11 09:34:11 PDT 2025


================
@@ -64,15 +64,18 @@ namespace {
 struct OutputFunctionCoverageData {
   StringRef Name;
   uint64_t Hash;
+  std::vector<std::string> FilenamesStorage;
   std::vector<StringRef> Filenames;
----------------
ellishg wrote:

Why not store the strings directly in Filenames rather than having a separate storage?

```suggestion
  std::vector<std::string> Filenames;
```

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


More information about the llvm-commits mailing list