[clang] [analyzer] Remove redundant bug type DoubleDelete (PR #147542)

DonĂ¡t Nagy via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 9 07:59:09 PDT 2025


================
@@ -412,7 +412,7 @@ class DerefClass{
 void testDoubleDeleteClassInstance() {
   DerefClass *foo = new DerefClass();
   delete foo;
-  delete foo; // newdelete-warning {{Attempt to delete released memory}}
+  delete foo; // newdelete-warning {{Attempt to free released memory}}
----------------
NagyDonat wrote:

I see your point and agree that _in that particular case_ the spelling with `free` is slightly worse than the old message that said `delete`, but I think that overall the _consistently_ slightly worse message is still better than the inconsistent situation where the checker could emit different messages in almost-identical situations.

I'll try to ensure that in the foreseeable future _somebody_ (e.g. an intern in our team) systemically updates the messages to use properly generic vocabulary and e.g. say "release" instead of "free".

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


More information about the cfe-commits mailing list