[clang] [analyzer] Ignoring `T v=v; ` idiom for uninitialized variable checker and dead store checker (PR #187530)

Balázs Benics via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 19 04:35:05 PDT 2026


================
@@ -431,6 +431,12 @@ class DeadStoreObs : public LiveVariables::Observer {
                   //  bug.
                   if (isa<ParmVarDecl>(VD) && VD->getType()->isScalarType())
                     return;
+                  // Special case: check for self-initializations.
+                  //
+                  //  e.g. int x = x;
+                  //
----------------
steakhal wrote:

Let's keep this short.
```suggestion
                  // Special case: check for self-initializations: e.g. int x = x;
```

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


More information about the cfe-commits mailing list