[all-commits] [llvm/llvm-project] d8eed1: [clang] Combine ConstRefUse with other warnings fo...
Igor Kudrin via All-commits
all-commits at lists.llvm.org
Wed Jul 9 21:20:33 PDT 2025
Branch: refs/heads/users/ikudrin/combine-uninitialized-warns
Home: https://github.com/llvm/llvm-project
Commit: d8eed1c557650bc30103a58fd1ea416e9d09e596
https://github.com/llvm/llvm-project/commit/d8eed1c557650bc30103a58fd1ea416e9d09e596
Author: Igor Kudrin <ikudrin at accesssoftek.com>
Date: 2025-07-09 (Wed, 09 Jul 2025)
Changed paths:
M clang/include/clang/Analysis/Analyses/UninitializedValues.h
M clang/lib/Analysis/UninitializedValues.cpp
M clang/lib/Sema/AnalysisBasedWarnings.cpp
Log Message:
-----------
[clang] Combine ConstRefUse with other warnings for uninitialized values
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 -c test.cpp -o /dev/nul -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