[PATCH] D51762: First part of the <chrono> calendar stuff

Marshall Clow via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 6 17:01:48 PDT 2018


mclow.lists created this revision.
mclow.lists added reviewers: EricWF, ldionne, howard.hinnant.

Before we get to actually doing calendar stuff, or time zone stuff, there's a whole bunch of support classes that need to be implemented. Things like `day`, `week`, `month`, `year`, `day_month`, etc.

This patch implements the first chunk of those.
Apologies for the size of the patch, but (like the <span> stuff), it's 90+% tests.


https://reviews.llvm.org/D51762

Files:
  include/chrono
  test/std/utilities/time/days.pass.cpp
  test/std/utilities/time/months.pass.cpp
  test/std/utilities/time/time.cal/euclidian.h
  test/std/utilities/time/time.cal/nothing_to_do.pass.cpp
  test/std/utilities/time/time.cal/time.cal.day/time.cal.day.members/ctor.pass.cpp
  test/std/utilities/time/time.cal/time.cal.day/time.cal.day.members/decrement.pass.cpp
  test/std/utilities/time/time.cal/time.cal.day/time.cal.day.members/increment.pass.cpp
  test/std/utilities/time/time.cal/time.cal.day/time.cal.day.members/ok.pass.cpp
  test/std/utilities/time/time.cal/time.cal.day/time.cal.day.members/plus_minus_equal.pass.cpp
  test/std/utilities/time/time.cal/time.cal.day/time.cal.day.nonmembers/comparisons.pass.cpp
  test/std/utilities/time/time.cal/time.cal.day/time.cal.day.nonmembers/literals.fail.cpp
  test/std/utilities/time/time.cal/time.cal.day/time.cal.day.nonmembers/literals.pass.cpp
  test/std/utilities/time/time.cal/time.cal.day/time.cal.day.nonmembers/minus.pass.cpp
  test/std/utilities/time/time.cal/time.cal.day/time.cal.day.nonmembers/plus.pass.cpp
  test/std/utilities/time/time.cal/time.cal.day/time.cal.day.nonmembers/streaming.pass.cpp
  test/std/utilities/time/time.cal/time.cal.day/types.pass.cpp
  test/std/utilities/time/time.cal/time.cal.last/types.pass.cpp
  test/std/utilities/time/time.cal/time.cal.md/time.cal.md.members/ctor.pass.cpp
  test/std/utilities/time/time.cal/time.cal.md/time.cal.md.members/day.pass.cpp
  test/std/utilities/time/time.cal/time.cal.md/time.cal.md.members/month.pass.cpp
  test/std/utilities/time/time.cal/time.cal.md/time.cal.md.members/ok.pass.cpp
  test/std/utilities/time/time.cal/time.cal.md/time.cal.md.nonmembers/comparisons.pass.cpp
  test/std/utilities/time/time.cal/time.cal.md/time.cal.md.nonmembers/streaming.pass.cpp
  test/std/utilities/time/time.cal/time.cal.md/types.pass.cpp
  test/std/utilities/time/time.cal/time.cal.mdlast/comparisons.pass.cpp
  test/std/utilities/time/time.cal/time.cal.mdlast/ctor.pass.cpp
  test/std/utilities/time/time.cal/time.cal.mdlast/month.pass.cpp
  test/std/utilities/time/time.cal/time.cal.mdlast/ok.pass.cpp
  test/std/utilities/time/time.cal/time.cal.mdlast/streaming.pass.cpp
  test/std/utilities/time/time.cal/time.cal.mdlast/types.pass.cpp
  test/std/utilities/time/time.cal/time.cal.month/time.cal.month.members/ctor.pass.cpp
  test/std/utilities/time/time.cal/time.cal.month/time.cal.month.members/decrement.pass.cpp
  test/std/utilities/time/time.cal/time.cal.month/time.cal.month.members/increment.pass.cpp
  test/std/utilities/time/time.cal/time.cal.month/time.cal.month.members/ok.pass.cpp
  test/std/utilities/time/time.cal/time.cal.month/time.cal.month.members/plus_minus_equal.pass.cpp
  test/std/utilities/time/time.cal/time.cal.month/time.cal.month.nonmembers/comparisons.pass.cpp
  test/std/utilities/time/time.cal/time.cal.month/time.cal.month.nonmembers/literals.pass.cpp
  test/std/utilities/time/time.cal/time.cal.month/time.cal.month.nonmembers/minus.pass.cpp
  test/std/utilities/time/time.cal/time.cal.month/time.cal.month.nonmembers/plus.pass.cpp
  test/std/utilities/time/time.cal/time.cal.month/time.cal.month.nonmembers/streaming.pass.cpp
  test/std/utilities/time/time.cal/time.cal.month/types.pass.cpp
  test/std/utilities/time/time.cal/time.cal.mwd/time.cal.mwd.members/ctor.pass.cpp
  test/std/utilities/time/time.cal/time.cal.mwd/time.cal.mwd.members/month.pass.cpp
  test/std/utilities/time/time.cal/time.cal.mwd/time.cal.mwd.members/ok.pass.cpp
  test/std/utilities/time/time.cal/time.cal.mwd/time.cal.mwd.members/weekday_indexed.pass.cpp
  test/std/utilities/time/time.cal/time.cal.mwd/time.cal.mwd.nonmembers/comparisons.pass.cpp
  test/std/utilities/time/time.cal/time.cal.mwd/time.cal.mwd.nonmembers/streaming.pass.cpp
  test/std/utilities/time/time.cal/time.cal.mwd/types.pass.cpp
  test/std/utilities/time/time.cal/time.cal.mwdlast/time.cal.mwdlast.members/ctor.pass.cpp
  test/std/utilities/time/time.cal/time.cal.mwdlast/time.cal.mwdlast.members/month.pass.cpp
  test/std/utilities/time/time.cal/time.cal.mwdlast/time.cal.mwdlast.members/ok.pass.cpp
  test/std/utilities/time/time.cal/time.cal.mwdlast/time.cal.mwdlast.members/weekday_last.pass.cpp
  test/std/utilities/time/time.cal/time.cal.mwdlast/time.cal.mwdlast.nonmembers/comparisons.pass.cpp
  test/std/utilities/time/time.cal/time.cal.mwdlast/time.cal.mwdlast.nonmembers/streaming.pass.cpp
  test/std/utilities/time/time.cal/time.cal.mwdlast/types.pass.cpp
  test/std/utilities/time/time.cal/time.cal.operators/month_day.pass.cpp
  test/std/utilities/time/time.cal/time.cal.operators/month_day_last.pass.cpp
  test/std/utilities/time/time.cal/time.cal.operators/month_weekday.pass.cpp
  test/std/utilities/time/time.cal/time.cal.operators/month_weekday_last.pass.cpp
  test/std/utilities/time/time.cal/time.cal.operators/year_month.pass.cpp
  test/std/utilities/time/time.cal/time.cal.operators/year_month_day.pass.cpp
  test/std/utilities/time/time.cal/time.cal.operators/year_month_day_last.pass.cpp
  test/std/utilities/time/time.cal/time.cal.operators/year_month_weekday.pass.cpp
  test/std/utilities/time/time.cal/time.cal.operators/year_month_weekday_last.pass.cpp
  test/std/utilities/time/time.cal/time.cal.wdidx/time.cal.wdidx.members/ctor.pass.cpp
  test/std/utilities/time/time.cal/time.cal.wdidx/time.cal.wdidx.members/index.pass.cpp
  test/std/utilities/time/time.cal/time.cal.wdidx/time.cal.wdidx.members/ok.pass.cpp
  test/std/utilities/time/time.cal/time.cal.wdidx/time.cal.wdidx.members/weekday.pass.cpp
  test/std/utilities/time/time.cal/time.cal.wdidx/time.cal.wdidx.nonmembers/comparisons.pass.cpp
  test/std/utilities/time/time.cal/time.cal.wdidx/time.cal.wdidx.nonmembers/streaming.pass.cpp
  test/std/utilities/time/time.cal/time.cal.wdidx/types.pass.cpp
  test/std/utilities/time/time.cal/time.cal.wdlast/time.cal.wdlast.members/ctor.pass.cpp
  test/std/utilities/time/time.cal/time.cal.wdlast/time.cal.wdlast.members/ok.pass.cpp
  test/std/utilities/time/time.cal/time.cal.wdlast/time.cal.wdlast.members/weekday.pass.cpp
  test/std/utilities/time/time.cal/time.cal.wdlast/time.cal.wdlast.nonmembers/comparisons.pass.cpp
  test/std/utilities/time/time.cal/time.cal.wdlast/time.cal.wdlast.nonmembers/streaming.pass.cpp
  test/std/utilities/time/time.cal/time.cal.wdlast/types.pass.cpp
  test/std/utilities/time/time.cal/time.cal.weekday/time.cal.weekday.members/ctor.pass.cpp
  test/std/utilities/time/time.cal/time.cal.weekday/time.cal.weekday.members/decrement.pass.cpp
  test/std/utilities/time/time.cal/time.cal.weekday/time.cal.weekday.members/increment.pass.cpp
  test/std/utilities/time/time.cal/time.cal.weekday/time.cal.weekday.members/ok.pass.cpp
  test/std/utilities/time/time.cal/time.cal.weekday/time.cal.weekday.members/operator[].pass.cpp
  test/std/utilities/time/time.cal/time.cal.weekday/time.cal.weekday.members/plus_minus_equal.pass.cpp
  test/std/utilities/time/time.cal/time.cal.weekday/time.cal.weekday.nonmembers/comparisons.pass.cpp
  test/std/utilities/time/time.cal/time.cal.weekday/time.cal.weekday.nonmembers/literals.pass.cpp
  test/std/utilities/time/time.cal/time.cal.weekday/time.cal.weekday.nonmembers/minus.pass.cpp
  test/std/utilities/time/time.cal/time.cal.weekday/time.cal.weekday.nonmembers/plus.pass.cpp
  test/std/utilities/time/time.cal/time.cal.weekday/time.cal.weekday.nonmembers/streaming.pass.cpp
  test/std/utilities/time/time.cal/time.cal.weekday/types.pass.cpp
  test/std/utilities/time/time.cal/time.cal.year/time.cal.year.members/ctor.pass.cpp
  test/std/utilities/time/time.cal/time.cal.year/time.cal.year.members/decrement.pass.cpp
  test/std/utilities/time/time.cal/time.cal.year/time.cal.year.members/increment.pass.cpp
  test/std/utilities/time/time.cal/time.cal.year/time.cal.year.members/is_leap.pass.cpp
  test/std/utilities/time/time.cal/time.cal.year/time.cal.year.members/ok.pass.cpp
  test/std/utilities/time/time.cal/time.cal.year/time.cal.year.members/plus_minus.pass.cpp
  test/std/utilities/time/time.cal/time.cal.year/time.cal.year.members/plus_minus_equal.pass.cpp
  test/std/utilities/time/time.cal/time.cal.year/time.cal.year.nonmembers/comparisons.pass.cpp
  test/std/utilities/time/time.cal/time.cal.year/time.cal.year.nonmembers/literals.fail.cpp
  test/std/utilities/time/time.cal/time.cal.year/time.cal.year.nonmembers/literals.pass.cpp
  test/std/utilities/time/time.cal/time.cal.year/time.cal.year.nonmembers/minus.pass.cpp
  test/std/utilities/time/time.cal/time.cal.year/time.cal.year.nonmembers/plus.pass.cpp
  test/std/utilities/time/time.cal/time.cal.year/time.cal.year.nonmembers/streaming.pass.cpp
  test/std/utilities/time/time.cal/time.cal.year/types.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ym/time.cal.ym.members/ctor.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ym/time.cal.ym.members/month.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ym/time.cal.ym.members/ok.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ym/time.cal.ym.members/plus_minus_equal_month.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ym/time.cal.ym.members/plus_minus_equal_year.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ym/time.cal.ym.members/year.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ym/time.cal.ym.nonmembers/comparisons.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ym/time.cal.ym.nonmembers/minus.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ym/time.cal.ym.nonmembers/plus.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ym/time.cal.ym.nonmembers/streaming.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ym/types.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymd/time.cal.ymd.members/ctor.local_days.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymd/time.cal.ymd.members/ctor.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymd/time.cal.ymd.members/ctor.sys_days.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymd/time.cal.ymd.members/ctor.year_month_day_last.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymd/time.cal.ymd.members/day.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymd/time.cal.ymd.members/month.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymd/time.cal.ymd.members/ok.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymd/time.cal.ymd.members/plus_minus_equal_month.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymd/time.cal.ymd.members/plus_minus_equal_year.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymd/time.cal.ymd.members/year.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymd/time.cal.ymd.nonmembers/comparisons.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymd/time.cal.ymd.nonmembers/minus.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymd/time.cal.ymd.nonmembers/plus.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymd/time.cal.ymd.nonmembers/streaming.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymd/types.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymdlast/time.cal.ymdlast.members/ctor.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymdlast/time.cal.ymdlast.members/day.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymdlast/time.cal.ymdlast.members/month.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymdlast/time.cal.ymdlast.members/month_day_last.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymdlast/time.cal.ymdlast.members/ok.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymdlast/time.cal.ymdlast.members/op_local_days.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymdlast/time.cal.ymdlast.members/op_sys_days.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymdlast/time.cal.ymdlast.members/plus_minus_equal_month.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymdlast/time.cal.ymdlast.members/plus_minus_equal_year.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymdlast/time.cal.ymdlast.members/year.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymdlast/time.cal.ymdlast.nonmembers/comparisons.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymdlast/time.cal.ymdlast.nonmembers/minus.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymdlast/time.cal.ymdlast.nonmembers/plus.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymdlast/time.cal.ymdlast.nonmembers/streaming.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymwd/time.cal.ymwd.members/ctor.local_days.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymwd/time.cal.ymwd.members/ctor.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymwd/time.cal.ymwd.members/ctor.sys_days.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymwd/time.cal.ymwd.members/ctor.year_month_day_last.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymwd/time.cal.ymwd.members/index.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymwd/time.cal.ymwd.members/month.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymwd/time.cal.ymwd.members/ok.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymwd/time.cal.ymwd.members/plus_minus_equal_month.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymwd/time.cal.ymwd.members/plus_minus_equal_year.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymwd/time.cal.ymwd.members/weekday.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymwd/time.cal.ymwd.members/weekday_indexed.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymwd/time.cal.ymwd.members/year.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymwd/time.cal.ymwd.nonmembers/comparisons.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymwd/time.cal.ymwd.nonmembers/minus.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymwd/time.cal.ymwd.nonmembers/plus.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymwd/time.cal.ymwd.nonmembers/streaming.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymwd/types.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymwdlast/time.cal.ymwdlast.members/ctor.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymwdlast/time.cal.ymwdlast.members/month.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymwdlast/time.cal.ymwdlast.members/ok.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymwdlast/time.cal.ymwdlast.members/op_local_days.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymwdlast/time.cal.ymwdlast.members/op_sys_days.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymwdlast/time.cal.ymwdlast.members/plus_minus_equal_month.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymwdlast/time.cal.ymwdlast.members/plus_minus_equal_year.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymwdlast/time.cal.ymwdlast.members/weekday.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymwdlast/time.cal.ymwdlast.members/year.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymwdlast/time.cal.ymwdlast.nonmembers/comparisons.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymwdlast/time.cal.ymwdlast.nonmembers/minus.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymwdlast/time.cal.ymwdlast.nonmembers/plus.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymwdlast/time.cal.ymwdlast.nonmembers/streaming.pass.cpp
  test/std/utilities/time/time.cal/time.cal.ymwdlast/types.pass.cpp
  test/std/utilities/time/time.duration/time.duration.literals/literals.pass.cpp
  test/std/utilities/time/time.duration/time.duration.literals/literals1.pass.cpp
  test/std/utilities/time/time.duration/time.duration.literals/literals2.pass.cpp
  test/std/utilities/time/weeks.pass.cpp
  test/std/utilities/time/years.pass.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51762.164322.patch
Type: text/x-patch
Size: 455800 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180907/2e52420e/attachment-0001.bin>


More information about the cfe-commits mailing list