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

via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 27 08:03:45 PST 2025


================
@@ -72,14 +72,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:: KnownUnannotatedAsThrowing
-
-   When `true`, treat calls to functions with visible definitions that are not
-   explicitly declared as non-throwing (i.e. lack ``noexcept`` or ``throw()``)
-   as potentially throwing, even if their bodies are visible and no explicit
-   throw is found. Default value is `false`.
-
-.. option:: UnknownAsThrowing
-
-   When `true`, treat calls to functions without visible definitions as
-   potentially throwing. Default value is `false`.
+.. 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``
----------------
EugeneZelenko wrote:

```suggestion
   `OnlyUndefined`
```

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


More information about the cfe-commits mailing list