This is an archive of the discontinued LLVM Phabricator instance.

[libcxx][test] ostream{,buf}_iterator::difference_type changes in C++20
ClosedPublic

Authored by ldionne on Sep 10 2020, 8:27 AM.

Details

Summary

Although libc++ doesn't yet implement this change, these tests should expect the difference type of std::ostream_iterator and std::ostreambuf_iterator specializations to be std::ptrdiff_t instead of void when testing C++ versions greater than 17 if the library under test is not libc++.

Diff Detail

Event Timeline

CaseyCarter created this revision.Sep 10 2020, 8:27 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 10 2020, 8:27 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
CaseyCarter requested review of this revision.Sep 10 2020, 8:27 AM

What paper is this? I searched but failed to find a paper this falls off from.

What paper is this? I searched but failed to find a paper this falls off from.

P0896R4 "The One Ranges Proposal" - Ranges demands that all iterators have useful difference types.

What paper is this? I searched but failed to find a paper this falls off from.

P0896R4 "The One Ranges Proposal" - Ranges demands that all iterators have useful difference types.

Ah, I see it. I'll add that bit to libc++ so we don't need special casing in the tests.

Ah, I see it. I'll add that bit to libc++ so we don't need special casing in the tests.

Feel free to steal this for your test changes. Shall I close this differential then?

ldionne commandeered this revision.Sep 10 2020, 9:31 AM
ldionne edited reviewers, added: CaseyCarter; removed: ldionne.

Ah, I see it. I'll add that bit to libc++ so we don't need special casing in the tests.

Feel free to steal this for your test changes. Shall I close this differential then?

No need, I'll steal it by commandeering.

ldionne updated this revision to Diff 291213.Sep 11 2020, 7:30 AM

Implement the changes for libc++.

CaseyCarter accepted this revision.EditedSep 11 2020, 5:26 PM

LGTM! (You should say "Partially implements P0896R4" in the commit log =))

libcxx/include/iterator
1052

std::iterator has been deprecated since C++17. Should this inheritance be dependent on _LIBCPP_STD_VER < 17? It's unnecessary now that the member types are defined directly. (Also on line 1161.)

ldionne accepted this revision as: Restricted Project.Sep 14 2020, 8:08 AM
This revision is now accepted and ready to land.Sep 14 2020, 8:08 AM
This revision was landed with ongoing or failed builds.Sep 14 2020, 8:08 AM
This revision was automatically updated to reflect the committed changes.