Please annotate findings in tidy bugprone-exception-escape
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.
@llvm/issue-subscribers-clang-tidy
Author: Yevgen Ryazanov (jackua22)
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.
I worked on a change, specifically https://reviews.llvm.org/D153298, to address an issue some time ago. However, I ended up abandoning it because the review process for this particular check was too painful, and I couldn't see an end in sight.
I'd sooner expect hell to freeze over than for me to touch this check again. So, if anyone wants to pick it up, feel free to do so.
I created another PR addressing this change, https://github.com/llvm/llvm-project/pull/134375. Hope it will land in near future