[clang] [analyzer] Improve dangling value tracking in DanglingPtrDeref (PR #211818)

via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 24 08:18:33 PDT 2026


github-actions[bot] wrote:

<!--PREMERGE ADVISOR COMMENT: Linux-->
# :penguin: Linux x64 Test Results

* 90519 tests passed
* 1712 tests skipped
* 1 test failed

## Failed Tests
(click on a test name to see its output)

### Clang
<details>
<summary>Clang.Analysis/dangling-ptr-deref.cpp</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/24/include -nostdsysteminc -analyze -setup-static-analyzer -analyzer-checker=core,alpha.cplusplus.DanglingPtrDeref    -analyzer-config cfg-lifetime=true -analyzer-output=text -verify /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Analysis/dangling-ptr-deref.cpp
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/24/include -nostdsysteminc -analyze -setup-static-analyzer -analyzer-checker=core,alpha.cplusplus.DanglingPtrDeref -analyzer-config cfg-lifetime=true -analyzer-output=text -verify /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Analysis/dangling-ptr-deref.cpp
# .---command stderr------------
# | error: 'expected-note' diagnostics seen but not expected: 
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Analysis/dangling-ptr-deref.cpp Line 91: 'num' initialized to 5
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Analysis/dangling-ptr-deref.cpp Line 92: Value assigned to 'ptr'
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Analysis/dangling-ptr-deref.cpp Line 107: 'num' initialized to 5
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Analysis/dangling-ptr-deref.cpp Line 126: Initializing to 0
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Analysis/dangling-ptr-deref.cpp Line 141: Value assigned to 'p'
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Analysis/dangling-ptr-deref.cpp Line 161: 'local_arr' declared without an initial value
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Analysis/dangling-ptr-deref.cpp Line 162: Value assigned to 'ptr'
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Analysis/dangling-ptr-deref.cpp Line 173: Initializing to 0
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Analysis/dangling-ptr-deref.cpp Line 185: 's.x' initialized to 0
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Analysis/dangling-ptr-deref.cpp Line 197: field 'x' initialized to 0
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Analysis/dangling-ptr-deref.cpp Line 209: 'o.inner.x' initialized to 0
# | 11 errors generated.
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>

If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label.

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


More information about the cfe-commits mailing list