[PATCH] D144748: [clang-tidy] Add bugprone-empty-catch check
Piotr Zegar via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Apr 16 06:35:19 PDT 2023
PiotrZSL marked 4 inline comments as done.
PiotrZSL added inline comments.
================
Comment at: clang-tools-extra/docs/clang-tidy/checks/bugprone/empty-catch.rst:147-153
+.. option:: IgnoreCatchWithKeywords
+
+ This option can be used to ignore specific catch statements containing
+ certain keywords. If a ``catch`` statement body contains (case-insensitive)
+ any of the keywords listed in this semicolon-separated option, then the
+ catch will be ignored, and no warning will be raised.
+ Default value: `@TODO;@FIXME`.
----------------
carlosgalvezp wrote:
> I'm not sure this option is worth the added complexity - if people want to allow an empty catch with a comment, they might as well just add a `NOLINT` to suppress the warning? It will be even more clear that it's actually a problem: it's not a regular `TODO` that doesn't necessarily imply a problem, but rather something that a static analyzer considers a problem.
>
>
I added this so people could have ability to ignore some issues without putting NOLINT's. This can be also used when developer put some macro into catch block, that would be build dependent, like assert or something.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D144748/new/
https://reviews.llvm.org/D144748
More information about the cfe-commits
mailing list