[clang] [Clang] Allow non-const lvalue refs to vector elements (except vector <bool>) (PR #156891)
John McCall via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 4 08:07:51 PDT 2025
https://github.com/rjmccall requested changes to this pull request.
I imagine that GCC allows this by just binding the reference to the address of the element in the vector. The way you're implementing this, we have to introduce the concept of a non-addressable reference, which would be a major change.
But in general, I'm fine with this; I don't think we really have a good reason to not allow references to bind to vector elements. We can still prefer to keep vectors as aggregates in CodeGen whenever it's reasonably possible.
https://github.com/llvm/llvm-project/pull/156891
More information about the cfe-commits
mailing list