[all-commits] [llvm/llvm-project] 76afb4: [analyzer] Fix misleading 'initialized here' note ...

Endre Fülöp via All-commits all-commits at lists.llvm.org
Mon Jun 8 15:29:40 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 76afb4d5433e3324a34be585ee3adab9ee9f3d2e
      https://github.com/llvm/llvm-project/commit/76afb4d5433e3324a34be585ee3adab9ee9f3d2e
  Author: Endre Fülöp <endre.fulop at sigmatechnology.com>
  Date:   2026-06-09 (Tue, 09 Jun 2026)

  Changed paths:
    M clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
    M clang/test/Analysis/cstring-uninitread-notes.c
    M clang/test/Analysis/placement-new.cpp
    M clang/test/Analysis/std-c-library-functions-arg-constraints-tracking-notes.c
    M clang/test/Analysis/std-c-library-functions-arg-constraints.c
    M clang/test/Analysis/uninit-const.c
    M clang/test/Analysis/uninit-vals.m

  Log Message:
  -----------
  [analyzer] Fix misleading 'initialized here' note for uninitialized d… (#198345)

…eclarations

When a variable is declared without an initializer, the
BugReporterVisitor would emit 'initialized here' as a note, which is
confusing because the variable was never initialized.
Change the note to 'declared without an initial value' for declarations
that have no initializer. Global-storage variables are also taken into
consideration.
Removed the SI.Value.isUndef() case, as it is unreachable in
practice because core.uninitialized.Assign (a core checker, always
enabled) reports
the assignment before this note can surface.



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