================
@@ -0,0 +1,31 @@
+.. title:: clang-tidy - bugprone-unsafe-to-allow-exceptions
+
+bugprone-unsafe-to-allow-exceptions
+===================================
+
+Finds functions where throwing exceptions is unsafe but the function is still
+marked as throwable. Throwing exceptions from the following functions can be
+problematic:
+
+* Destructors
+* Move constructors
+* Move assignment operators
+* The ``main()`` functions
+* ``swap()`` functions
+* ``iter_swap()`` functions
+* ``iter_move()`` functions
+
+The check finds any of these functions if it is marked with ``noexcept(false)``
+or ``throw(exception)``. This would indicate that the function is expected to
+throw exceptions. Only the presence of these keywords is checked, not if the
+function actually throws any exception.
+
+Options
+-------
+
+.. option:: CheckedSwapFunctions
----------------
balazske wrote:

Is there a pre-defined set of swap function names for C++ that can be used for 
this value (instead of a checker option)? Have these swap functions not exactly 
2 parameters (the current condition is that it should have at least 1 parameter 
but probably this is not correct, even if this was copied from the 
`exception-escape` check).

https://github.com/llvm/llvm-project/pull/176430
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to