[clang] [analyzer] Ignoring `T v=v; ` idiom for uninitialized variable checker and dead store checker (PR #187530)
Ella Ma via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 1 05:24:02 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;
+ //
+ if (VD == V)
----------------
Snape3058 wrote:
OK. I will add that.
https://github.com/llvm/llvm-project/pull/187530
More information about the cfe-commits
mailing list