[clang] [LifetimeSafety] Fix false positives for pointers in loops (PR #182368)
via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 13 00:17:06 PDT 2026
github-actions[bot] wrote:
<!--PREMERGE ADVISOR COMMENT: Windows-->
# :window: Windows x64 Test Results
* 53233 tests passed
* 1024 tests skipped
* 1 test failed
## Failed Tests
(click on a test name to see its output)
### Clang
<details>
<summary>Clang.Sema/warn-lifetime-safety-dataflow.cpp</summary>
```
Exit Code: 1
Command Output (stdout):
--
# RUN: at line 1
c:\_work\llvm-project\llvm-project\build\bin\clang.exe -cc1 -internal-isystem C:\_work\llvm-project\llvm-project\build\lib\clang\23\include -nostdsysteminc -mllvm -debug-only=LifetimeFacts -Wlifetime-safety C:\_work\llvm-project\llvm-project\clang\test\Sema\warn-lifetime-safety-dataflow.cpp 2>&1 | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\clang\test\Sema\warn-lifetime-safety-dataflow.cpp
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\clang.exe' -cc1 -internal-isystem 'C:\_work\llvm-project\llvm-project\build\lib\clang\23\include' -nostdsysteminc -mllvm -debug-only=LifetimeFacts -Wlifetime-safety 'C:\_work\llvm-project\llvm-project\clang\test\Sema\warn-lifetime-safety-dataflow.cpp'
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\clang\test\Sema\warn-lifetime-safety-dataflow.cpp'
# .---command stderr------------
# | C:\_work\llvm-project\llvm-project\clang\test\Sema\warn-lifetime-safety-dataflow.cpp:29:11: error: CHECK: expected string not found in input
# | // CHECK: Expire ({{[0-9]+}} (Path: p))
# | ^
# | <stdin>:35:22: note: scanning from here
# | Expire (0 (Path: x))
# | ^
# | <stdin>:36:2: note: possible intended match here
# | Expire (1 (Path: p), Origin: 2 (Decl: p, Type : MyObj *))
# | ^
# |
# | Input file: <stdin>
# | Check file: C:\_work\llvm-project\llvm-project\clang\test\Sema\warn-lifetime-safety-dataflow.cpp
# |
# | -dump-input=help explains the following input dump.
# |
# | Input was:
# | <<<<<<
# | .
# | .
# | .
# | 30: Use (2 (Decl: p, Type : MyObj *), Read)
# | 31: Issue (1 (Path: p), ToOrigin: 3 (Expr: DeclRefExpr, Decl: p))
# | 32: OriginFlow:
# | 33: Dest: 4 (Expr: ImplicitCastExpr, Type : MyObj *)
# | 34: Src: 2 (Decl: p, Type : MyObj *)
# | 35: Expire (0 (Path: x))
# | check:29'0 X error: no match found
# | 36: Expire (1 (Path: p), Origin: 2 (Decl: p, Type : MyObj *))
# | check:29'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | check:29'1 ? possible intended match
# | 37: OriginEscapes (4 (Expr: ImplicitCastExpr, Type : MyObj *), via Return)
# | check:29'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | 38: End of Block
# | check:29'0 ~~~~~~~~~~~~~~
# | 39: Block B0:
# | check:29'0 ~~~~~~~~~~~
# | 40: End of Block
# | check:29'0 ~~~~~~~~~~~~~~
# | 41: ==========================================
# | check:29'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | .
# | .
# | .
# | >>>>>>
# `-----------------------------
# 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/182368
More information about the cfe-commits
mailing list