[all-commits] [llvm/llvm-project] 977cfe: [Analysis] Avoid some warnings about exit from nor...

Serge Pavlov via All-commits all-commits at lists.llvm.org
Mon Jul 14 22:56:33 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 977cfea786401eab2b167307221a15fa6747e28e
      https://github.com/llvm/llvm-project/commit/977cfea786401eab2b167307221a15fa6747e28e
  Author: Serge Pavlov <sepavloff at gmail.com>
  Date:   2025-07-15 (Tue, 15 Jul 2025)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/Sema/AnalysisBasedWarnings.cpp
    A clang/test/SemaCXX/noreturn-vars.cpp

  Log Message:
  -----------
  [Analysis] Avoid some warnings about exit from noreturn function (#144408)

Compiler sometimes issues warnings on exit from 'noreturn' functions, in
the code like:

    [[noreturn]] extern void nonreturnable();
    void (*func_ptr)();
    [[noreturn]] void foo() {
      func_ptr = nonreturnable;
      (*func_ptr)();
    }

where exit cannot take place because the function pointer is actually a
pointer to noreturn function.

This change introduces small data analysis that can remove some of the
warnings in the cases when compiler can prove that the set of reaching
definitions consists of noreturn functions only.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list