<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/108979>108979</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Clang false positive missing-designated-field-initializers
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
sabudilovskiy
</td>
</tr>
</table>
<pre>
#include <string>
struct Test {
std::string a;
std::string b;
};
int main() { (void)Test{.b = ""}; }
expected behaviour: ok
got behaviour: missing field 'a' initializer [-Wmissing-designated-field-initializers]
8 | int main() { (void)Test{.b = ""}; }
https://godbolt.org/z/hTa1vEo1M
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysUsGOmzAQ_ZrhYhGBDTEcfEjCcuttpZ5tPIHpOjjCBnX36ysnUbPtoephJWvG8puZN-_JOgQaZ0QF9RHqLtNrnPyigjarJee38EbvmfH2XQEXNA9utchAnEJcaB5BvEDRQXG4xxCXdYjsFUNkII_3R8YYC9GCOIA43NuYBvEP1PxGQXbP-y3SHNlF0wy8Ad4mFga82TxZ4G0iBnncGQaiY8B5OrcRLKVPY_DnFYeIlhmc9EZ-XUAcmH-7o6OPfwIXCiFtdiZ0lgGXGrhkNFMk7egDFwb1Mf_-KMstJlN1RJvfOvJPlQHq7im9YSBP7ItETTFeQ3KS98D70VvjXdz5ZQTefwDvp1ddbi--_JZZJWwrWp2hKiXf1w0vZJVNqhL2XBetkbUZ6krWzVA1RWUFNlVTobQZKV7wqmhLWVaFrMXO2HIYcN8YPJf7EjVUBV40uZ1z2yVxZxTCiqosmla2mdMGXbh9Ns4Hp-cxqam7bFGpITfrGKAqHIUYniMiRYfqlMrZWbuA7OoDRdqQ_Zfl2bo49Zc7FKfV7AZ_Ad4nokfKr4v_gUME3t8WD8D7x-6b4r8CAAD__yCA9ZY">