This is an archive of the discontinued LLVM Phabricator instance.

[libc++][ranges] Fix incorrect integer type in `view_interface` tests.
ClosedPublic

Authored by var-const on Jan 10 2023, 8:37 PM.

Details

Summary

ForwardIter() - ForwardIter() returns ptrdiff_t, and converting it
to an unsigned type isn't guaranteed to produce the same type as
size_t.

Diff Detail

Event Timeline

var-const created this revision.Jan 10 2023, 8:37 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 10 2023, 8:37 PM
var-const requested review of this revision.Jan 10 2023, 8:37 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 10 2023, 8:37 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
var-const added inline comments.Jan 10 2023, 8:38 PM
libcxx/test/std/ranges/range.utility/view.interface/view.interface.pass.cpp
237–240

Please let me know if you think this line is overkill.

ldionne accepted this revision.Jan 11 2023, 2:35 PM
ldionne added a subscriber: ldionne.

Thanks!

libcxx/test/std/ranges/range.utility/view.interface/view.interface.pass.cpp
237–240

I would add a comment that says something like // test the test.

This revision is now accepted and ready to land.Jan 11 2023, 2:35 PM
This revision was landed with ongoing or failed builds.Jan 11 2023, 5:43 PM
This revision was automatically updated to reflect the committed changes.