llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

[LifetimeSafety] Origin length mismatch (assertion) in `VisitInitListExpr` when constructing `gsl::Pointer`

Open NeKon69 opened this issue 5 months ago • 2 comments

Minimal repro:

struct [[gsl::Pointer()]] Ptr { int x; };
Ptr f() { return Ptr{}; }

https://godbolt.org/z/vbb56GeeT

This was found by a local Qwen 3.6 35B3A while testing one of my PRs.

NeKon69 avatar Jun 14 '26 13:06 NeKon69

I would also like to work on this myself.

NeKon69 avatar Jun 14 '26 13:06 NeKon69

@llvm/issue-subscribers-clang-temporal-safety

Author: NeKon69

Minimal repro: ```cpp struct [[gsl::Pointer()]] Ptr { int x; }; struct Owner { int y; }; Ptr f(Owner o) { return Ptr{}; } ``` https://godbolt.org/z/vbb56GeeT

This was found by a local Qwen 3.6 35B3A while testing one of my PRs.