<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/87422>87422</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Please annotate findings in tidy bugprone-exception-escape
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
jackua22
</td>
</tr>
</table>
<pre>
When tidy reports a violations, it looks like
```
an exception may be thrown in function 'main' which should not throw exceptions [bugprone-exception-escape]
2801 | int main(int argc, char *argv[])
| ^
```
or
```
somefile.cpp:2425:11: an exception may be thrown in function 'operator=' which should not throw exceptions [bugprone-exception-escape]
2425 | Data& operator=(Data&&) = default;
```
It is not so actionable or ergonomic. It is an important finding, must be fixed, but it takes a lot of time to find the cause. One line of a note will save a lot of efforts.
In the last example, I opened CLion, which immediately highlighted the move constructor with a message "Move constructor should be marked noexcept". Simple and clear. Yes, we run tidy with select checks, and performance-noexcept-move-constructor is not in the same group as bugprone-exception-escape.
In the first example, I did not even find the source of an exception, it can be thousands lines of somebody's code. Yes, I know, I can add a big catch and get the source control ownership of all the lines in main function. But it would help if the tool explains its findings.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVE2PozgT_jXOpRREDOTjwCHdeVtq6V3tSntY7bEwBdTE2Mg2Sfe_X9kwnZ5Rj7SHjZAg5fp4_NRThd5zb4hqUT2J6rLBOQzW1d9QXWeUctPY9r3-ayADgdt3cDRZFzwg3NhqDGyNF_IZOIC29upB85VEfhH5Wezz9Ul_0QC9KZpiCIz4Dg1BGJy9G2AD3WxUOhHyMCIbIQ9wH1gN4Ac76xaMDYv7I4sHUT01cz85a2j7Yd6SVziRqC5LYZDHfAfi8AxsAizJj_ETXa8idjWgAyHP6PrbwoKQpzU2_WJself_-_Jq1n1p9nakjjVlappEcZalrERx3u1EcYZ_z4adyGGwThSX_5SUUlbrxS4YUMg9_FDpuFrTcw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