================ @@ -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) { ---------------- spavloff wrote:
> We are checking the initializer here, but we don't check to make sure it > wasn't assigned since then, right? No, the statements in a basic block are scanned in backward direction. So if the basic block contains an assignment, it will be tested first. > IMO it seems this is a failure of [[noreturn]] not being part of the type :) You are not alone. For instance, GCC developers have the same opinion: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80495#c1. https://github.com/llvm/llvm-project/pull/144408 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits