[PATCH] D112981: Fix iterator_adaptor_base/enumerator_iter to allow composition of llvm::enumerate with llvm::make_filter_range

Duncan P. N. Exon Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 3 17:47:57 PDT 2021


dexonsmith added a comment.

In D112981#3107398 <https://reviews.llvm.org/D112981#3107398>, @dexonsmith wrote:

> Here are two examples that I think this patch breaks:
>
>   const int &ConstRef = *std::declval<const const_iterator &>(); // (example #1)
>   int &Ref = *std::declval<const iterator &>(); // (example #2)

I was wrong that these would fail, but the reason seems a bit subtle: it appears that `const ReferenceT` is the same as `int&` when `ReferenceT` is `int&`.

I didn't see the revert here, and wrote https://reviews.llvm.org/D113158 to go on top. There were a few other problems to work through. Happy to rebase that if it makes sense.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112981/new/

https://reviews.llvm.org/D112981



More information about the llvm-commits mailing list