This is an archive of the discontinued LLVM Phabricator instance.

[libc++][ranges] Addresses: LWG3719 - Directory iterators should be usable with default sentinel
ClosedPublic

Authored by H-G-Hristov on Jun 19 2023, 10:47 AM.

Details

Summary

Addresses: LWG3719 - Directory iterators should be usable with default sentinel
https://wg21.link/LWG3719

Diff Detail

Event Timeline

H-G-Hristov created this revision.Jun 19 2023, 10:47 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 19 2023, 10:47 AM
H-G-Hristov retitled this revision from [libc++][filesystem][regex] Implements: LWG3719 - Directory iterators should be usable with default sentinel to [libc++][ranges] Implements: LWG3719 - Directory iterators should be usable with default sentinel.Jun 19 2023, 12:16 PM

Try to fix CI

H-G-Hristov edited the summary of this revision. (Show Details)Jun 19 2023, 10:07 PM
H-G-Hristov retitled this revision from [libc++][ranges] Implements: LWG3719 - Directory iterators should be usable with default sentinel to [libc++][ranges] Addresses: LWG3719 - Directory iterators should be usable with default sentinel.
  • Fixed includes
  • Fixed includes
  • Fix CI

Try again CI

Try to fix CI

H-G-Hristov published this revision for review.Jun 21 2023, 3:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 21 2023, 3:16 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript

Thanks for working on this! Several minor comments.

libcxx/include/__filesystem/directory_iterator.h
106

This should be C++20. The LWG issues are normally bugs in the C++ Standard. We apply these to all versions of C++ back to C++03. However default_sentinel_t was introduced in C++20, so it requires C++20 or newer.

libcxx/include/filesystem
322

Thanks for updating the synopsis!

libcxx/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/equal.pass.cpp
26

Note for these small tests I don't mind having all code in main.

29

Please test the following properties too

  • returns a bool using AssertEqualityReturnBool
  • noexcept using AssertEqualityAreNoexcept

Addressed comments

H-G-Hristov marked 4 inline comments as done.

Tweaks

@Mordante Thank you for the review!

libcxx/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/equal.pass.cpp
29

Thank you for the tip!

Updated sinopsises + Rebased

Mordante accepted this revision.Jun 23 2023, 9:13 AM

LGTM, but please make sure the CI passes in C++20 before committing.

libcxx/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/equal.pass.cpp
9

Please update the other tests too.

29

In this case I would omit the extra scope, but I don't strongly object either.

This revision is now accepted and ready to land.Jun 23 2023, 9:13 AM

Addressed comments

H-G-Hristov marked 2 inline comments as done.Jun 23 2023, 12:51 PM
H-G-Hristov added inline comments.
libcxx/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/equal.pass.cpp
9

Thank you! Sorry about this oversight.

H-G-Hristov marked an inline comment as done.Jun 23 2023, 12:52 PM