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

    <tr>
        <th>Summary</th>
        <td>
            [clang-tidy] suggest adding `constexpr` when it is possible
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang-tidy,
            check-request
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
            5chmidti
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          5chmidti
      </td>
    </tr>
</table>

<pre>
    Add a check to suggest adding `constexpr` to variables and functions to the extent that each standard version allows. Using `constexpr` can, e.g., potentially uncover UB in code, as that is not permitted in a `constexpr` context.

I'm refactoring my prototype that ran successfully on the `clang` and `clang-tools-extra` targets (using a more restrictive mode than the standard permits) with working fixits. I need to finish the implementation, add more tests, and evaluate the check against some code-bases before posting the PR though.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyEk8-OpDYQxp_GXEqNwNNA94HD7Ixa2lsUaR-gsAtw1tjEVfSft49M9ySREmkvWBjX7_P3UYXMbgpEvWq-Ka0bMy_OilNaq-azwE3mmPqv3WKI9tG_WwsIZibzEyQCb9NELIDWujCBaisTAwvd16TaKp-4YnI4eGLAYGHcghEXA-dPMhPQXSgIyIwChGYGFgwWk4UrJXYxAHofb1zCD_4_BYNB6Q-gcirzusaMc-j9A7Zg4pUS_PgGLoCJlvIJ5KeYYwhRYKW0OBGy-Qz-Fx-D0F1KVX2q6v35_K50t0CiEY3ElC-1PGBNUaI8VnrSEwbgzRhiHrd8mRh2u5nvMUyZnfP4ej9IjJ4PdJeEe3CYJhIGpU_b7hthiYkgEUtyRtyVYIl2V3uS_87t6YiVPsPNyQy3mH5mwujuTriE7xCIbM5_dMHxvFe7ZfW0UBDMf2fPydqnpBBn2sd-X7qi31BoL3p2AU7oAgtwXGhP-TAgE8NAYy5fI0uWzwW__Q4yx22ay8L2b_b8dsaC-rp7q-uzPnZdMfdd22KjG9O1TXU8dkjNeGrbsSJTddQOTeF6XeljXVdnrY9d05WnZrCI7XCqKlN3g1bHihZ0vvT-upQxTYVj3qiv66bVuvA4kOdXx7-yd_aRe15_5K1s6pDoz41YXpOQ-sw6DNvE6lh5x8L_0MWJ3yfoX7Dm81eTcZspgNvbcI3MbvBUbMn3s8jK6u1d6YvSl8nJvA2liYvSl6z4Wg5rin-QEaUvuzlW-vLyd-31XwEAAP__8FxMQA">