<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/65700>65700</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
-Wuninitialized does not find issue with assigning from uninitialized struct
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue,
clang:diagnostics
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
wheatman
</td>
</tr>
</table>
<pre>
`-Wuninitialized` does not seem to find issues with assigning from an uninitialized struct
https://godbolt.org/z/f1daE83sM
code
```
struct Foo {
int y;
};
int main() {
Foo f;
int x = f.y; // no warning
return x;
}
```
I would expect to get a warning similar to gcc like
```
<source>: In function 'int main()':
<source>:7:9: warning: 'f.Foo::y' is used uninitialized [-Wuninitialized]
7 | int x = f.y; // no warning
| ^
<source>:6:9: note: 'f' declared here
6 | Foo f;
| ^
Compiler returned: 0
```
but get no warnings at all with `-Weverything`
tested with post 16 trunk(68e94f1f27b658183c3ebbce4aaadc437d0cee3a)
I found this issue when looking at https://github.com/llvm/llvm-project/issues/5847 but this seemed like a more basic issue so I created a new one
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycVM2O4zYMfhr6QmwgS7GdHHzITsbAHHruWZboWB1ZCiR5M7NPX8hONjtpUKAFAsUSyY8_H0kZozk5ohaq71AdCzmn0Yf2MpJMk3RF7_VnCzX79ufsjDPJSGt-koaaofYU0fmEkWjC5HEwTqOJcaaIF5NGXMGNO-EQ_ITS4RcQjCnMKiGwI7DDmNI5gjgA74B3J697b9PGhxPw7ifwbii1fN2J-Meqvp7Ka7rea3b9LdcrdOc9QvN9fUPjEn6CuF6hOd6_lzPLJ2kc8B3w_W-GiAvS8Es_v2TtDwRxxGGTUXGNHJ3Hiww57btuoDQHhx9fnP_m-SH69XzDi5-tRvo4k0q5widKKG_oGM1krAyLQCm05v15LUC8RD8HRSBeQRzwzeEwO5WMdwi8-Zo18CaT8MwwC_YZ4JaeOGT7YdN5n23E4RN4gybiHEk_cA3V98ceqo73AjUIzQv-17LiYgXV69N461u8zie6BZsj1KSsDKRxpEB3tPpXDP8k-8HTi5_OxlK4Eks6w7N_4bKf08LePYuIMqG0dh2VZcToB4XPNOYUa3Ydi0QxkV6Vzj4mLGtMYXbvwHf1jvbboRx409fVrtwJJajvFW2llFptRaOZIhIy0_qlrwY_O41pNHGdV7yM5NB6_577SiZ8GEaTxrnfKD8B76z9cfv7dg7-L1IJeLeOPfCu2m0bzNku6Hk1kF5aEyVOPhD2Mhp1dRs9vqEKJHOKEh1d0LsrI4Vuhd6LvSyoLev9thSi5FUxtpUeBlELVpdSlJLras96piu2G7ai38u-MC1nXLA92zEmOKs2pAXvRVlWTSMk7xlsGU3S2E1OIq-YYgmnrauGscLKnmxcFiLnOaRFCJwDfwHOlZVL62sjT87HZFTMsupYhHYpSj-fImyZNTHFu4dkkqX2YQTuO_S-O5-uzqd7s5iDbf8_U0u2fwcAAP__B7_NXg">