[clang-tools-extra] [clang-tidy] Add options to throw unannotated functions in `bugprone-exception-escape` (PR #168324)

Congcong Cai via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 3 00:07:22 PST 2026


================
@@ -71,3 +71,23 @@ 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 not consider functions without explicitly declared exception
+      specification as throwing, unless they have a body which is visible to the
+      check and the check can deduce that the function throws.
+   - `OnlyUndefined`
+      The check will consider functions without visible definitions as throwing.
+   - `All`
+      The check will consider functions without visible definitions as throwing,
----------------
HerrCai0907 wrote:

IMO, definitions means function with body and declarations means functions without body.
I get the point that here you want to describe throwable annotation (?). I hope we can have a better description for it.

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


More information about the cfe-commits mailing list