[PATCH] D152330: [clang-tidy] Check functions called from catch blocks

Deniz Evrenci via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 6 19:09:07 PDT 2023


denizevrenci added inline comments.


================
Comment at: clang-tools-extra/test/clang-tidy/checkers/bugprone/exception-escape-coro.cpp:132-136
     if constexpr (ThrowInUnhandledException) {
       throw 1;
+    } else if constexpr (RethrowInUnhandledException) {
+      throw;
     }
----------------
ChuanqiXu wrote:
> I don't know clang-tidy a lot. But is these two branches different in clang-tidy really?
Yes, rethrows are handled differently than throw expressions with arguments. You can find the relevant implementation in ExceptionAnalyzer.cpp:[462:475].


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D152330/new/

https://reviews.llvm.org/D152330



More information about the cfe-commits mailing list