This is an archive of the discontinued LLVM Phabricator instance.

[libc++][chrono] Adds operator<=> for day.
ClosedPublic

Authored by Mordante on Jun 26 2022, 2:02 AM.

Details

Reviewers
ldionne
Group Reviewers
Restricted Project
Commits
rGfd36a3d48d05: [libc++][chrono] Adds operator<=> for day.
Summary

Since the calendar classes were introduced in C++20 there's no need to
keep the old comparison operators.

This commit does the day calender class, the other calendar classes will
be in a followup commit.

Implements parts of:

  • P1614R2 The mothership has landed

Diff Detail

Event Timeline

Mordante created this revision.Jun 26 2022, 2:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 26 2022, 2:02 AM
Mordante requested review of this revision.Jun 26 2022, 2:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 26 2022, 2:02 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
ldionne requested changes to this revision.Jul 6 2022, 9:49 AM
ldionne added a subscriber: ldionne.
ldionne added inline comments.
libcxx/include/chrono
16

We have a test for mandated inclusions, does it need to be updated?

libcxx/test/support/test_comparisons.h
10–13

Suggestion:

FooOrder<expected-ordering> => All seven comparison operators
FooComparison => All six pre-C++20 comparison operators
FooEqual => operator== and operator!=

This can be done in a separate patch. I don't think we actually need to have a separate FooES for testing operator== and operator<=> only, if that's already tested in FooOrder (which would then test all 7 operators).

132–133

Funky indentation.

This revision now requires changes to proceed.Jul 6 2022, 9:49 AM
Mordante updated this revision to Diff 443436.Jul 9 2022, 6:33 AM
Mordante marked an inline comment as done.

Addresses review comments.

Most new changes will be moved to a separate patch.

ldionne accepted this revision.Jul 12 2022, 9:41 AM
This revision is now accepted and ready to land.Jul 12 2022, 9:41 AM
Mordante updated this revision to Diff 444045.Jul 12 2022, 12:28 PM

Rebase on landed 129578 to test CI.

This revision was automatically updated to reflect the committed changes.