This is an archive of the discontinued LLVM Phabricator instance.

[libc++] [ranges] ADL-proof ranges::iter_{swap,move}.
ClosedPublic

Authored by Quuxplusone on Jan 25 2022, 8:41 PM.

Details

Summary

As discovered in D117817, std::ranges::input_range<Holder<Incomplete>*[10]>
hard-errored before this patch. That's because input_range requires
iter_rvalue_reference_t, which requires iter_move, which was
not ADL-proofed.

Add ADL-proofing tests to all the range refinements.
output_range and common_range shouldn't be affected,
and all the others subsume input_range anyway, but we might as
well be thorough.

Diff Detail

Event Timeline

Quuxplusone requested review of this revision.Jan 25 2022, 8:41 PM
Quuxplusone created this revision.
Herald added 1 blocking reviewer(s): Restricted Project. · View Herald TranscriptJan 25 2022, 8:41 PM
Quuxplusone updated this revision to Diff 403489.EditedJan 26 2022, 9:02 PM

Restore a (void) I'd removed; turns out it is needed in order to suppress a user-provided iter_swap's [[nodiscard]] attribute. (Fun.)
https://buildkite.com/llvm-project/libcxx-ci/builds/8158

Rebase, and remove refactoring that doesn't affect this particular bug. Ping @ldionne!

ldionne accepted this revision.Jan 31 2022, 8:25 AM
This revision is now accepted and ready to land.Jan 31 2022, 8:25 AM