[clang-tools-extra] [clang-tidy] Add options to throw unannotated functions in `bugprone-exception-escape` (PR #168324)
Baranov Victor via cfe-commits
cfe-commits at lists.llvm.org
Fri Feb 6 08:26:19 PST 2026
================
@@ -71,3 +71,22 @@ Options
Comma separated list containing type names which are not counted as thrown
exceptions in the check. Default value is an empty string.
+
+.. option:: TreatFunctionsWithoutSpecificationAsThrowing
+
+ Determines which functions are considered as throwing if they do not have
+ an explicit exception specification. It can be set to the following values:
+
+ - `None`
+ The check will consider functions without an explicit exception
+ specification as throwing only if they have a visible definition which
+ can be deduced to throw.
+ - `OnlyUndefined`
+ The check will consider functions with only a declaration available as
+ throwing.
----------------
vbvictor wrote:
```suggestion
The check will consider functions with only a declaration available and
no visible definition as throwing.
```
Since we use term `definition` in other descriptions, lets follow the same pattern here.
https://github.com/llvm/llvm-project/pull/168324
More information about the cfe-commits
mailing list