[clang-tools-extra] [clang-tidy]: Ignore empty `catch` blocks in destructors in `bugprone-empty-catch` check (PR #161379)

Baranov Victor via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 30 08:38:39 PDT 2025


vbvictor wrote:

> Instead of enabling this check by default and requiring users to disable it for destructors, the check should be disabled for destructors by default, with an option to turn it on if a user explicitly needs it.

There is a partial consensus in clang-tidy reviewers (at least [carlosgalvezp](https://github.com/carlosgalvezp) and me) that we should make checks strict by default with options to be less strict.
The rationale is: if don't like some option - you can disable it easily, but if an option is off-by-default you may not even ever find about it - and this is potentially bad for end-user.

I hope @PiotrZSL would take a look at this PR since he was the author of the check.

https://github.com/llvm/llvm-project/pull/161379


More information about the cfe-commits mailing list