[clang] [Analysis] Avoid some warnings about exit from noreturn function (PR #144408)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 25 10:46:45 PDT 2025


================
@@ -399,6 +401,145 @@ static bool isNoexcept(const FunctionDecl *FD) {
   return false;
 }
 
+/// Checks if the given variable, which is assumed to be a function pointer, is
+/// initialized with a function having 'noreturn' attribute.
+static bool isInitializedWithNoReturn(const VarDecl *VD) {
----------------
erichkeane wrote:

Huh, interesting.  We've not been following that at all in clang, instead preferring to keep anonymous namespaces in most places.  We'll have to discuss that.

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


More information about the cfe-commits mailing list