[clang] [LifetimeSafety] Fix crash on explicit object member functions (PR #212154)

Hugues Hoppe via cfe-commits cfe-commits at lists.llvm.org
Sun Oct 4 07:38:51 PDT 2026


hhoppe wrote:

Could this fix be backported to release/23.x? The crash from #204210 is still present in 23.1.2. This variant crashes clang 23.1.0 and 23.1.2 with `-std=c++23 -Wlifetime-safety`, while current trunk compiles it cleanly:

```cpp
struct View {
  int* _p;
  View operator[](this auto&& self, int i) { return View{self._p + i}; }
};
View get();
void f() { (void)get()[0]; }
```

I don't have permission to set the milestone. Could someone with triage rights add "LLVM 23.x Release" and request the cherry-pick of be9dcc5d877dab8e38a344c7890856fbb70bef15? Thanks.


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


More information about the cfe-commits mailing list