[PATCH] D147417: [clang-tidy] Do not emit bugprone-exception-escape warnings from coroutines

Chuanqi Xu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 3 00:53:56 PDT 2023


ChuanqiXu added inline comments.


================
Comment at: clang-tools-extra/test/clang-tidy/checkers/bugprone/exception-escape-coro.cpp:75-79
+  // CHECK-MESSAGES-NOT: :[[@LINE-1]]:11: warning: an exception may be thrown in function 'b_ShouldNotDiag' which should not throw exceptions
+  if (b == 0)
+    throw b;
+
+  co_return a / b;
----------------
I don't understand why we shouldn't emit the warning here. Since the function is marked `noexcept` but it may throw actually in `unhandled_exception`. I think it is meaningful to warn for this.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147417



More information about the cfe-commits mailing list