[all-commits] [llvm/llvm-project] f0befb: [clang] Combine ConstRefUse with other warnings fo...

Igor Kudrin via All-commits all-commits at lists.llvm.org
Thu Jul 10 18:24:41 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f0befb0dcda4e908f6cd0b771753a36cc5fb980f
      https://github.com/llvm/llvm-project/commit/f0befb0dcda4e908f6cd0b771753a36cc5fb980f
  Author: Igor Kudrin <ikudrin at accesssoftek.com>
  Date:   2025-07-10 (Thu, 10 Jul 2025)

  Changed paths:
    M clang/include/clang/Analysis/Analyses/UninitializedValues.h
    M clang/lib/Analysis/UninitializedValues.cpp
    M clang/lib/Sema/AnalysisBasedWarnings.cpp
    A clang/test/SemaCXX/uninitialized-multiple-uses.cpp
    M clang/test/SemaCXX/warn-uninitialized-const-reference.cpp

  Log Message:
  -----------
  [clang] Combine ConstRefUse with other warnings for uninitialized values (#147898)

This helps to avoid duplicating warnings in cases like:
```
> cat test.cpp
void bar(int);
void foo(const int &);
void test(bool a) {
  int v = v;
  if (a)
    bar(v);
  else
    foo(v);
}
> clang++.exe test.cpp -fsyntax-only -Wuninitialized
test.cpp:4:11: warning: variable 'v' is uninitialized when used within its own initialization [-Wuninitialized]
    4 |   int v = v;
      |       ~   ^
test.cpp:4:11: warning: variable 'v' is uninitialized when used within its own initialization [-Wuninitialized]
    4 |   int v = v;
      |       ~   ^
2 warnings generated.
```



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