[libcxx-commits] [PATCH] D117371: [libcxx][test] {move, reverse}_iterator cannot be instantiated for a type with no `operator*` in C++20

Casey Carter via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sat Jan 15 13:18:23 PST 2022


CaseyCarter added a comment.

In D117371#3246031 <https://reviews.llvm.org/D117371#3246031>, @Quuxplusone wrote:

> I'd like @ldionne to make an executive decision about whether libc++ should continue to compile `move_iterator<ToIter>`, as an extension, in pre-C++20 modes. (`class ToIter` does not have an `operator*`: //dereferencing// such a `move_iterator` wouldn't compile, but merely forming the //type// is currently legal in libc++ pre-C++20.)
> If we think our "extension" is important, then this PR is removing test coverage. If we think no sane user would ever make a move_iterator of a non-iterator type, then this PR is a great simplification.

I'm happy to make the presence of `operator*` depend on the language mode under test if we do want to preserve this extension, although it seems very low-value to me.

> Scope creep: Same question but in re the fact that `ToIter` doesn't have an `operator++` either. If we discover we also need to add an `operator++` to `ToIter`, would //that// be removing test coverage?

There are a ton of types named "MeowIterator" in the test suite that conform to neither the old iterator requirements nor the new iterator concepts. It's not my goal to fix them all, merely to correct test failures for `stdlib=msvc`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D117371



More information about the libcxx-commits mailing list