<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/77507>77507</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Non-viable constructor makes function call ambiguous
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          Eisenwave
      </td>
    </tr>
</table>

<pre>
    https://godbolt.org/z/1WzddG5KE
```cpp
struct A {
  explicit A(int = 0);
  // A()= default;
} a = {};
```
Clang considers this ill-formed both if you comment out the second constructor uncomment it. In its current state, clang emits:
```none
<source>:4:3: error: chosen constructor is explicit in copy-initialization
    4 | } a = {};
      |   ^ ~~
<source>:2:12: note: explicit constructor declared here
    2 | explicit A(int = 0);
      |            ^
```
When uncommenting the second constructor, we get:
```none
<source>:4:3: error: call to constructor of 'struct A' is ambiguous
    4 | } a = {};
      |   ^ ~~
<source>:2:12: note: candidate constructor
    2 |   explicit A(int = 0);
      |            ^
<source>:3:3: note: candidate constructor
    3 |   A()= default;
      |   ^
```
This is nonsensical. `A(int)` can't simultaneously
- be viable and cause an ambiguous overload, and
- be non-viable and cause `= {}` to be ill-formed when it's the only overload.

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0VU1v4zYQ_TXjy8CGRMpWdNDBG8dFUaCnAnumyJHFliINfiR1DvvbC0qxFae7iwBFBcOSyPl4fG9mJELQJ0vUwvYLbA8rkeLgfPukA9kX8UyrzqlLO8R4DsD3wI7AjienOmfixvkTsOMrsGP59VWpX7a_PUFxgGIPu2L-yfN5XgnRJxlxj1B_mVcQ6e-z0VJH3AN70DYi8AMWwBrgN5s54WQxbRxQUS-SiTcbqA8oJtccuj4sG1cQ8-ujEfaE0tmgFfmAcdABtTHr3vmRFHYuDqh7vLiE0o0j2YguRYwDYSDprJqcp3M4j8lejXTc4K8WdQwok_d5KUQRCdgjyikpjTpO7N3jss7S2xJ_DC55ScCfgO8r4HsOfI_kvfP5QQ4ukL0DoMNCoM5b58taWx21MPpVRO3slUPECqF-xB8yhdOVTRBh-4Tfvn0XFgO-L_MfWhdpwncF8B6YImmEJ4UDeVoSsCnBZzRfwNwu2H6srPn160B2kULb0w_kylq8EJ4o_jcZhDEY3d1xXY_A6mt9A6uzMmLs9Cm5FP5_DaSwSisR6e68H2j_XLP9lPh7HPzKzSdh8LfAP2nkDwx8V-8_pqYNaJ0NZIOWwmwQdsXboXLkXZGxAKsjBj0mE4Ull4K5zBHW2BE-a9EZQpGLRKSQnxbJ0D2TN06oXDTCqnd-1tn1v3wzuEXPXZELpKP3o-UlV6mOuUym-nTWXG5ZNnP8lWq5angjVtSWdVE9sO1uV66Gtu93D7KWu4YU9cRL2YhSyqYpKiFF0zysdMsKVhVl0ZQPVVmUG8EbJXjBS7lTXV9VUBU0Cm02xjyPeWivdAiJ2rreFvXKiI5MmMY_Y5ZecNoExvLXwLfZZ92lU4CqMDrEsESJOhpqf184ed8Wo_iLAvbJyjyK5s65UbxK3nz8pug4pG4j3QjsmFO83dZn7_4kGYEdJ2AB2HEC_k8AAAD__5hQ-jw">