[clang] Suppress noreturn warning if last statement in a function is a throw (PR #145166)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 24 11:25:06 PDT 2025


================
@@ -624,8 +624,29 @@ struct CheckFallThroughDiagnostics {
   }
 };
 
-} // anonymous namespace
+bool isKnownToAlwaysThrow(const FunctionDecl *FD) {
+  if (!FD->hasBody())
----------------
erichkeane wrote:

It seems we have the ability to try A  LOT harder in this function, so I'd like a FIXME at the top of it that says something like:

"This is always going to be a best effort, at the moment it only handles a function that contains only a single-expression that is a 'throw', and then only in limited circumstances'.

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


More information about the cfe-commits mailing list