[all-commits] [llvm/llvm-project] fdfd37: [clang][analyzer] Diagnose dead stores on parenthe...

Cristiano Lacerda via All-commits all-commits at lists.llvm.org
Fri Oct 2 07:57:47 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fdfd37c0148b6186c19cc9ffa3f2cbfeb2948533
      https://github.com/llvm/llvm-project/commit/fdfd37c0148b6186c19cc9ffa3f2cbfeb2948533
  Author: Cristiano Lacerda <61819301+crisclacerda at users.noreply.github.com>
  Date:   2026-10-02 (Fri, 02 Oct 2026)

  Changed paths:
    M clang/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp
    M clang/test/Analysis/dead-stores.c

  Log Message:
  -----------
  [clang][analyzer] Diagnose dead stores on parenthesized lvalues (#227176)

This commit fixes that `deadcode.DeadStores` previously failed to diagnose a
dead store when the assigned variable is wrapped in parentheses.

```c
int f(int input) {
  int value;
  (value) = input;
  value = 2;
  return value;
}
```

This change was made with assistance of an AI tool (OpenAI Codex), which
implemented the fix (IgnoreParens()) and the test.
I have found the false negative myself (on a real codebase that uses a
code generator) and ran the tests manually.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list