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

    <tr>
        <th>Summary</th>
        <td>
            [clang] Value-initialisation of type with `noexcept(false)` trivial default constructor incorrectly potentially-throwing
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang
      </td>
    </tr>

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

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

<pre>
    ```
struct S {
  S() noexcept(false) = default;
};

static_assert(noexcept(S()));
static_assert(__is_nothrow_constructible(S));
```

Clang incorrectly fails these two static assertions.

For the former, `S()` is value-initialization, and so by https://eel.is/c++draft/dcl.init#general-9.1 it is zero-initialised without default-initialization, and the default constructor (being trivial) is not called. As such, because the default constructor is not implicitly invoked, it does not meet the requirements for https://eel.is/c++draft/except.spec#6.2 and the assertion should pass.

For the latter, https://eel.is/c++draft/meta.unary.prop#9 checks effectively `S s();` (as not-a-function-declaration) not `S s;`, and thus should check whether value-initialization is potentially-throwing, as above.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMVNGOozoM_ZrwYhXRUFp44GG6VX9gpftahWCK74aEm5j2dr9-FWA6M6uutFLUosjn2D4-sQqBrhaxFsVRFKdETdw7X989Etqkce2jFvtsPdlJZG-B_aQZvoM4HJcbgO9ClkJWYB3-r3FkIctOmYDxTuQnaLFTk2GRrwhxOH18r6yKSV9UCOgj_BPTSr6ed9jvgMuFwsU67r27X7SzS5nUGFwovoB_a2n5_WaUvQJZ7bxHzeYBnSITgHsMCHx3sOSEJSc5G9LP-LPzMRY65wf0Qn4Dsc_ei99nQAFuyky4IUtMytBPFUlioLItBAfNA3rmMYj8TcizkGdEk1IQ8qyFPAp5bL3qWMhzq00aWYTMr2jRK7Op0i0QxyQ_0btnjoAt3Il7N_H7FP6QP5a-RsBTP-dByLJBsldgTzdSJs6UAljHoJUx2KbwFiBMuo9MDWo1Rbn-wLYiaRgNaYoik725H9hGMDG0DpeIAZFnFo__TeRxQMshavuXEi32ScOIWsh8n8pnk8_xQejdZFoYVXg9SaOYl0n-Xc4BWaWTVf6Rjt6NQuYV6B71jwDYdaiZbmgesy0grMbIj9EbQpZq7nujNt1kdSxv06I2yq9DqmZVVugM-hjcFN5bmbPBvUfu0b-0W5zA6BhtvDOPzfxgyF5ntgCqcTdMk7bO2yqvVIL1dl-Vu1JmRZb0dVdVWZlvu6Ys2v22KrRudo3OsZC4bWSzT6iWmcy3mSyzMt9ts1RjdlDNrswPSheHqhC7DAdFJjXmNqTOXxMKYcL6kBW7IjGqQRPmZSSljg9SSBn3kq9j_KaZrkHsMkOBwwcDE5t5gy2I4gT_fOk8LJ27Dvgx4vweopIvtlWcxerz1_b9tB1eqZhM3tRfzXIl7qcm1W4Q8hxLXv82o3f_oo6-mRWIfppF-BUAAP__WYDRaA">