[clang] [analyzer][NFC] Take BugReport descriptions as Twine instead of StringRef (PR #205527)

Balázs Benics via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 24 04:16:34 PDT 2026


================
@@ -156,19 +156,17 @@ void CXXArrayDeleteChecker::checkTypedDeleteExpr(
   if (!N)
     return;
 
-  SmallString<256> Buf;
-  llvm::raw_svector_ostream OS(Buf);
-
   QualType SourceType = BaseClassRegion->getValueType();
   QualType TargetType =
       DerivedClassRegion->getSymbol()->getType()->getPointeeType();
 
-  OS << "Deleting an array of '" << TargetType.getAsString()
-     << "' objects as their base class '"
-     << SourceType.getAsString(C.getASTContext().getPrintingPolicy())
-     << "' is undefined";
-
-  auto R = std::make_unique<PathSensitiveBugReport>(BT, OS.str(), N);
+  auto R = std::make_unique<PathSensitiveBugReport>(
+      BT,
+      "Deleting an array of '" + TargetType.getAsString() +
----------------
steakhal wrote:

Fixed in 9c10cd167455d13c8b94ab27ab7adaf3b00b54ed. After that patch, there are no more std::string concats.

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


More information about the cfe-commits mailing list