[all-commits] [llvm/llvm-project] b32b31: [LifetimeSafety] Fix compiler crash with `static o...
NeKon69 via All-commits
all-commits at lists.llvm.org
Mon Mar 23 09:53:55 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: b32b31e6a7d003a96d8110c3debd891ba6977d25
https://github.com/llvm/llvm-project/commit/b32b31e6a7d003a96d8110c3debd891ba6977d25
Author: NeKon69 <nobodqwe at gmail.com>
Date: 2026-03-23 (Mon, 23 Mar 2026)
Changed paths:
M clang/lib/Analysis/LifetimeSafety/FactsGenerator.cpp
M clang/test/Sema/warn-lifetime-safety.cpp
Log Message:
-----------
[LifetimeSafety] Fix compiler crash with `static operator()` (#187853)
This PR removes the first argument from the `Args` list (which is `S()`)
before doing lifetime safety checks to ensure correct indexing.
It also adds a test to prevent regressions in the future
Fixes #187426
<details>
<summary>Bug details</summary>
When calling a `static operator()` directly (with `S()(...)`), we also
store `S()` in `Args` as the first argument, so all indexing is off by
one.
The most interesting part is that `S::operator()(...)` works correctly
and does not add `S()` at the beginning of the argument list, so it does
not crash during lifetime checks.
This solution is probably not the cleanest, but I would love to hear
feedback on where to put it!
</details>
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