[clang] [LifetimeSafety] Add suggestion and inference for implicit this (PR #176703)

via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 20 22:08:50 PST 2026


github-actions[bot] wrote:

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

* 85474 tests passed
* 1216 tests skipped
* 1 test failed

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

### Clang
<details>
<summary>Clang.Sema/warn-lifetime-safety-suggestions.cpp</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
rm -rf /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/Sema/Output/warn-lifetime-safety-suggestions.cpp.tmp
# executed command: rm -rf /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/Sema/Output/warn-lifetime-safety-suggestions.cpp.tmp
# note: command had no output on stdout or stderr
# RUN: at line 2
split-file /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/warn-lifetime-safety-suggestions.cpp /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/Sema/Output/warn-lifetime-safety-suggestions.cpp.tmp
# executed command: split-file /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/warn-lifetime-safety-suggestions.cpp /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/Sema/Output/warn-lifetime-safety-suggestions.cpp.tmp
# note: command had no output on stdout or stderr
# RUN: at line 3
/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/23/include -nostdsysteminc -fsyntax-only -fexperimental-lifetime-safety -fexperimental-lifetime-safety-inference -fexperimental-lifetime-safety-tu-analysis -Wexperimental-lifetime-safety-suggestions -Wexperimental-lifetime-safety -Wno-dangling -I/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/Sema/Output/warn-lifetime-safety-suggestions.cpp.tmp -verify /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/Sema/Output/warn-lifetime-safety-suggestions.cpp.tmp/test_source.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/23/include -nostdsysteminc -fsyntax-only -fexperimental-lifetime-safety -fexperimental-lifetime-safety-inference -fexperimental-lifetime-safety-tu-analysis -Wexperimental-lifetime-safety-suggestions -Wexperimental-lifetime-safety -Wno-dangling -I/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/Sema/Output/warn-lifetime-safety-suggestions.cpp.tmp -verify /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/Sema/Output/warn-lifetime-safety-suggestions.cpp.tmp/test_source.cpp
# .---command stderr------------
# | error: 'expected-warning' diagnostics seen but not expected: 
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/Sema/Output/warn-lifetime-safety-suggestions.cpp.tmp/test_source.cpp Line 130: implict this in intra-TU function should be marked [[clang::lifetimebound]]
# | error: 'expected-note' diagnostics seen but not expected: 
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/Sema/Output/warn-lifetime-safety-suggestions.cpp.tmp/test_source.cpp Line 131: param returned here
# | 2 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/176703


More information about the cfe-commits mailing list