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

    <tr>
        <th>Summary</th>
        <td>
            `bugprone-exception-escape` should ignore `consteval`
        </td>
    </tr>

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

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

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

<pre>
    The clang-tidy check `bugprone-exception-escape` should ignore the `consteval` functions. These are only executed at compile time and if they throw an exception the compilation fails.

```cpp
consteval int consteval_fn(int a)
{
    if (a == 0)
        throw 1;
    return a;
}

int test() noexcept
{
    return consteval_fn(1);
}
```
https://godbolt.org/z/G9WGK3d56

To trigger the warning you can call a `consteval` function with `throw` statement.
You can also mark such `consteval` function with `noexcept`. I'm not sure how to interpret the intention in the second case so may this is not worth fixing.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUU11vnDoQ_TXmZbQIDCzsAw-JVhtd3ddIV_epGsyA3Rgb2Sab7a-vDHQTpa2qIgSMmTnnzBd6r0ZD1LLqkVXnBJcgrWuFHNCHpLP9rX2WBEKjGQ9B9TcQksQLsGPWLePsrKEDvQmag7LmQF7gTOyYgZd20T2o0VhHECTFCGGND_SKOnoMixExyKfwLMkToCOwRt-A3kgsgXrAAMJOs9IEQU0EaHpQQ0S7QZDOXgEN3NlXls0fV3tApX3KsjPLHvbnMdtuMc_byV0SKBPZduvLYBhv4hEyftqD68ftAwCiDMYbBFacWXGG7O4F-7Xpy1nxIchRWJwBvB-y-vxRXuQL5APjDeMnMHbL7Rf0O9InvXlU8TP2j6Q3U4Ywe1Y8MH5h_DLavrM6pNaNjF--MX55Ov339G_RV8ePyp4tBKfGkdxa5Ss6o8wIN7uAQAMCtQb8bYvhqoKMf9eirOMRMNBEJuzt-X8HQu0tTOhewC9C_hnwXqJjlsI_jNcTGBvAL45A2isEG_tKbnYUVuXRMiuE2gbGk7CmB4GeYOWOo6U8KL8iXa0LEgb1psyYJn1b9KfihAm1ec2LuqiqOk9kK7DiVTMg8rrvsC7zrMCBN3lRDmVRNk2iWp7xMmvyKq_4Mc9SzvOmqE6iLvO8I6pZmdGESqdav06xG4nyfqE2z8qyqhONHWm_Linn78vIOI9L69oYdeiW0bMy08oH_44TVNDU_t2-fqp7sjjdfpobFeTSpcJOjF8i1_46zM5-JREYv6wJeMYvew6vLf8eAAD__wI5ZtY">