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

    <tr>
        <th>Summary</th>
        <td>
            [Clang] -Wmissing-constinit triggers when the suggested change causes compilation error
        </td>
    </tr>

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

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

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

<pre>
    I have a header that declares a `constinit const` array, and a cpp file that initializes it with `constexpr` (because I want to be able to use it in further constexpr functions in that cpp file).

This triggers `-Wmissing-constinit` pointed at the initializing declaration, together with a suggestion to add `constinit` to the declaration. However, doing so leads to a compilation error, because `constexpr` and `constinit` cannot be combined on a single declaration.

[CE link](https://godbolt.org/z/4r4Y9G9db).

</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxsU0tz4ygQ_jXo0mUXxpIfBx3yWO_mvlVbe2ygBcxgUAGyJ_n1UxAnmWTmJFV19_fqBnN2JhCNbLhnw2OHS7ExjTYmCmdMnYz6eXwCixcCBEuoKUGxWECT8pgoAwLbcRVDLi64Au2P7ThgSvjMxANg0ICg5hkm5-l1urY69O6FMrgCV1fsOwz9mFMFYOIgSeGSCZ7giqFAiSAJUFaUCLXgKhRMSyqWEryPw7QEVVwMuZYb4xs_E8c143eM3_1rXYaSnDGUcmVf_Xd2ObtgVu92qo45ulBIAxYolj6ku2BuKWClqlZLNNSUNEMIeTGGcq1Wwaj1p6wqeIkN9BecNfwTr3ShVAF1rCw5gifUuYGAiufZ-dYLlFJsjW9JfQ2xhv-VU2EIsdQoVTxLF0hDDFWtC8Z_1vKaFBvuH_4C78J3NjwycbClzJlt75g4MXEyUcvoyzomw8TphYlTn_r_j38ftbyF3elxq4_bI3Y0bvb9frs_HMSus-M07ZUWGveTpmmDXOt-t9npAyklJcm-c6PgYuDDZsf3nIvdejNth54fjnIa9hsxbVnP6YzOr72_nKuEzuW80LjpueDbzqMkn9t1C6E8BsOEqIeexjqwkovJrOfe5ZI_IIorvj2JhzYxPMIfTuPjdK6WQtvibd2kQVkMhqDtJP--sW5JfvySoit2kWsVz0ycqpLbZzWn-I1UYeLUnGUmTjdzl1H8DAAA__8aF0OZ">