This is an archive of the discontinued LLVM Phabricator instance.

[libc++][chrono] Uses operator<=> in the calendar.
ClosedPublic

Authored by Mordante on Jul 15 2022, 11:04 AM.

Details

Reviewers
ldionne
Group Reviewers
Restricted Project
Commits
rG41f7bb9975bc: [libc++][chrono] Uses operator<=> in the calendar.
Summary

Since the calendar is added in C++20 the existing operators are removed.

Implements part of:

  • P1614R2 The Mothership has Landed

Diff Detail

Event Timeline

Mordante created this revision.Jul 15 2022, 11:04 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 15 2022, 11:04 AM
Mordante requested review of this revision.Jul 15 2022, 11:04 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 15 2022, 11:04 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
ldionne accepted this revision.Jul 26 2022, 9:04 AM
ldionne added a subscriber: ldionne.
ldionne added inline comments.
libcxx/include/__chrono/year_month.h
55–60

Is this an omission?

libcxx/test/std/time/time.cal/time.cal.ym/time.cal.ym.nonmembers/comparisons.pass.cpp
43–52

Let's just always use 1010, I don't think we gain any fundamental coverage by doing more than that (do you agree?).

And in fact, we probably also want to test boundary values (at least year{0} and year{1}) if we don't already.

libcxx/test/std/time/time.cal/time.cal.ymd/time.cal.ymd.nonmembers/comparisons.pass.cpp
102

Same comment about number of steps and boundary values.

This revision is now accepted and ready to land.Jul 26 2022, 9:04 AM
Mordante marked 3 inline comments as done.Jul 27 2022, 9:33 AM

Thanks for the review!

libcxx/include/__chrono/year_month.h
55–60

Yes, thanks for spotting the issue.

libcxx/test/std/time/time.cal/time.cal.ym/time.cal.ym.nonmembers/comparisons.pass.cpp
43–52

I'll change the range to -5 to 5. Same for the next one.

Mordante updated this revision to Diff 448076.Jul 27 2022, 9:34 AM
Mordante marked 2 inline comments as done.

Rebased and addresses the review comments.
I will land this after the CI is happy.

This revision was landed with ongoing or failed builds.Jul 27 2022, 12:53 PM
This revision was automatically updated to reflect the committed changes.