[clang-tools-extra] [clang-tidy] Add check 'bugprone-unsafe-to-allow-exceptions' (PR #176430)
Balázs Kéri via cfe-commits
cfe-commits at lists.llvm.org
Fri Feb 6 09:04:45 PST 2026
================
@@ -0,0 +1,54 @@
+// RUN: %check_clang_tidy -std=c++11,c++14 %s bugprone-unsafe-to-allow-exceptions %t -- -- -fexceptions
+// RUN: %check_clang_tidy -std=c++11,c++14 -check-suffix=,CUSTOMSWAP %s bugprone-unsafe-to-allow-exceptions %t -- \
----------------
balazske wrote:
It works in any C++ version but the exception specification syntax was changed after C++17 and the file would not compile with later version (`throw(exception)` is not allowed in later C++).
https://github.com/llvm/llvm-project/pull/176430
More information about the cfe-commits
mailing list