https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100795
--- Comment #3 from 康桓瑋 <hewillk at gmail dot com> --- (In reply to 康桓瑋 from comment #2) > ranges::inplace_merge has the same issue: > > > #include <algorithm> > #include <array> > #include <ranges> > > int main() { > std::array a{42, 42, 42}; > auto r = std::views::iota(0, 3) | > std::views::transform([&a](int i) -> int& { return a[i]; }); > std::ranges::inplace_merge(r, r.begin()); > } > > https://godbolt.org/z/q6jbxGMjd Same for ranges::stable_sort and ranges::stable_partition. (https://godbolt.org/z/qffGMW477)