[clang] [NFC][analyzer] Add regression tests from bisection commits to the CSA's test suite (PR #241058)

Balázs Benics via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 11 02:40:22 PST 2026


================
@@ -437,3 +439,10 @@ void no_CXXRecordDecl() {
 void checkReference(std::string &s) {
   const char *c = s.c_str();
 }
+
+const char *GH59870(int value) {
+  thread_local std::string retval;
+
+  retval = std::to_string(value);
+  return retval.c_str(); // no-warning
+}
----------------
steakhal wrote:

I'm not convinced that this test tests what it should. It depends on how faitful our std::string mock is - which is. The only way to find out is by reverting the supposed fix and see if it would fire.
If not, then the test is wrong. If yes, then it's likely good.

Also, the bare `no-warning` probably needs an explanation what not to expect here (in other words, what was there and why it's better that its not there).

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


More information about the cfe-commits mailing list