martong added inline comments.
================ Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:323 + std::string("Function argument constraint is not satisfied, ") + + VC->getName().data() + ", ArgN: " + std::to_string(VC->getArgNo()); if (!BT_InvalidArg) ---------------- martong wrote: > steakhal wrote: > > balazske wrote: > > > baloghadamsoftware wrote: > > > > Instead of `std::string` we usually use `llvm::SmallString` and an > > > > `llvm::raw_svector_ostream` to print into it. > > > This would look better? > > > "Function argument constraint is not satisfied, constraint: <Name>, ArgN: > > > <ArgN>" > > Maybe `llvm::Twine` would be a better choice to `llvm::raw_svector_ostream` > > for string concatenations. > > docs: > > > Twine - A lightweight data structure for efficiently representing the > > > concatenation of temporary values as strings. > We can use a Twine to create the owning std::string without creating interim > objects. But then we must pass an owning object to the ctor of > PathSensitiveBugReport, otherwise we might end up with dangling pointers. > https://llvm.org/docs/ProgrammersManual.html#dss-twine Yes, I like this. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79431/new/ https://reviews.llvm.org/D79431 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits