[llvm] [ADT] Fix llvm::concat_iterator for `ValueT == common_base_class *` (PR #144744)

Javier Lopez-Gomez via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 23 06:08:52 PDT 2025


jalopezg-git wrote:

> I took a closer look and I think I understand what the underlying issue was: with mixed pointer types, reference/handle type can no longer be `T*&` / `T**` because while it's fine to cast derived pointers to `T*`, we can't take an address off them using that base type.

Yeah, I have updated the PR description s.t. it is more clear about that.

> I wonder if we should tighten this check to make sure that at least one input range type doesn't match the `ValueT` pointer type, and with that having them be returned via the same logic as `ReturnsByValue` doesn't sounds too bad to me. WDYT?

The current definition of `ReturnsConvertiblePointer` requires that all iterator types in `ItersT` are convertible to the pointer type `ValueT` :+1:; otherwise, it falls back to the old logic based on `ReturnsByValue`.

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


More information about the llvm-commits mailing list