[clang] [clang][analyzer] Ignore unnamed bitfields in UninitializedObject (PR #132427)
Abhinav Kumar via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 21 12:35:03 PDT 2025
kr-2003 wrote:
> Could you add a test case that fails before your patch?
Sure, here it is
## Testcase
```cpp
struct S
{
S(bool b)
: b(b)
{}
bool b{false};
long long : 7; // padding
};
void f()
{
S s(true);
}
```
### Before Patch
<img width="954" alt="Screenshot 2025-03-22 at 1 02 08 AM" src="https://github.com/user-attachments/assets/557a81a7-d569-48b2-b7db-18513d9e271d" />
### After Patch
<img width="956" alt="Screenshot 2025-03-22 at 1 03 50 AM" src="https://github.com/user-attachments/assets/8e025041-e368-4e86-9e91-8f426333f2f3" />
https://github.com/llvm/llvm-project/pull/132427
More information about the cfe-commits
mailing list