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

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 24 09:20:54 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:

Hmm... We are checking the initializer here, but we don't check to make sure it wasn't assigned since then, right?  

IMO it seems this is a failure of `[[noreturn]]` not being part of the type :)

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


More information about the cfe-commits mailing list