<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/132001>132001</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
`clang-analyzer-optin.cplusplus.UninitializedObject` false positive with unnamed fields
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang:static analyzer,
false-positive
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
firewave
</td>
</tr>
</table>
<pre>
```cpp
struct S
{
S(bool b)
: b(b)
{}
bool b{false};
long long : 7; // padding
};
void f()
{
S s(true);
}
```
```
<source>:4:9: warning: 1 uninitialized field at the end of the constructor call [clang-analyzer-optin.cplusplus.UninitializedObject]
4 | : b(b)
| ^
<source>:7:15: note: uninitialized field 'this->'
7 | long long : 7; // padding
| ^
<source>:12:7: note: Calling constructor for 'S'
12 | S s(true);
| ^~~~~~~
<source>:4:9: note: 1 uninitialized field at the end of the constructor call
4 | : b(b)
| ^
```
https://godbolt.org/z/7zzoK97x5
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJycVMGSoyoU_Zrr5lZSCCHowoVJdzZv8Rap9wGoaHhFwBJMT2cx3z6FmnS6p6tnqlNR5ALnHM69IL3XnVWqAL4D_pTIMZzcULR6UC_yopLKNa8FbMn8r_seSOnDMNYBj0BKEDsgJR6BZpVzBiugeQwgIrAydrPHkNiBeFo6y3yxa6XxKsbZbhkyznbzK4IIYDsEegB6wF42jbbdxLwsAFJenG6wBZrNVIsoRDyiB5qFYVRxZJ4-CbjvaAZ412V778ahVsCegZUbYGUeZbzIwUZqVmKKo9VWBy2NvqoGW61MgzJgOClUtkHXTp-1s7NXbsBaGoPAd7WRtltJK83rVQ0r1wdt13VvRh-f9X-PwP9W_6s6AL9ZtkEQe_zM3Ft8GuPPv29DACtTHpdZF1RsP9sCUBFO2q_iGioWVjGh_01OFv4HLV8oSuki665oL43RtntnW-uGqOp4l5PSO8En2X1TAPz55_T7IqU34u_m849peVTzocxOIfQeWDmb2Lmmcias3dABPVyBHsT16v7JxQ-eNAVrcpbLRBWp2FCWkSznyanYtnWT12JLJKGS8KwlOWGSZ9tGVputEokuKKGcsDRPySZlfC1J26SK5GmEIzKHDVFnqc3amMs5cifa-1EVKaOEpImRlTJ-uhkoneoWWOmDDLrGWwEDpUD3QOl0ile98zroi4ph_pQMRUReVWPnYUOM9sG_cQUdjIp3yzeOxJbgRIg3QnzR4YSjtfJ8S6BPxsEUH3zW4TRW69qdgR6ikqVZ9YObgOlhssADPSwuXAr6KwAA__83NH8g">