<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/61692>61692</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
libc++ type deduction failure
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
ianloic
</td>
</tr>
</table>
<pre>
Clang is having trouble deciding which constructor to call in a set of types. Types that look like this:
```
struct OneOptionalStringStruct {
struct Storage {
std::optional<std::string> s;
};
OneOptionalStringStruct(Storage&&) noexcept;
explicit OneOptionalStringStruct(std::optional<std::string> s) noexcept;
};
```
can't be constructed when the we pass the designated initializer for `Storage` like:
```
OneOptionalStringStruct ooss{{.s = "hello"}};
```
This works fine when we don't use libc++.
Here's a godbolt of a reduced test-case: https://godbolt.org/z/bPdzYfcnv
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMU8Fu4zgM_Rr6QjRwpMSuDz40zQZ76wLtZY-yRNvaqpIhyk3br1_IyUwyxQQYQLAsknrk46MUsx08UQvbHWz3hZrTGGJrlXfB6qIL5rN9dMoPaBlH9W79gCmGuXOEhrQ12XAcrR5RB88pzjqFiCmgVs6h9aiQKWHoMX1OxCt8yRumUSV0Ibyis6-EabQM8gHKPZQPUJXntRxPoPjk6WlKNnjlnlO0fng-2aHeneIQEc-xzylENdCVj5PJ-PIhnDFAPv608YIH8i9kkFdoUO8v5xv5Qdyfs4GoltWgD_ShaUq_gNHH5Ky2N4mAuP_jIn-X47rYbx3UyoOoE3Z0EYkMHkfymEbCI-GkmJd_Q3kgVPZbb5NVzn5RxD5EhKr8QbUqF91uSXZLqxCYsyb1bsUIco8gxEjOBRAi13-bwun7MlrGY4ivjL31dGJwJDThRHBmQmc7DWIHYre6vvo3RQJRMyocgumCW2ZSYSQzazKYiNOdVpw54ZjStMyjOIA4nONXIQ4gDl8gDt0_5uvfXvv3wrTSNLJRBbXrqm6qpt7WTTG2fVc2purXG1KiV43cNFXX3VdUqs1WCV0XthWlkKUUGyFkI5vVplHr2tBa1kI2HW1hU9Kbsm7l3Ptbzl1Y5pnaal01onCqI8fLqxXC0xEXZ27jdl_ENt-56-aBYVM6y4kvKMkmR-2lS8u7RJPbkBXDXlk3Ryrm6NpvfbBpnLuVDm8gDhnvvN1NMfxHeYIPSxUM4rBU-X8AAAD__z4sXpI">