[libcxx-commits] [PATCH] D70346: [libc++] [LWG3321] Mark "year_month_day_last::day() specification does not cover !ok() values" issue as "Nothing to do", but add assertion.

Howard Hinnant via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jun 9 07:06:05 PDT 2020


howard.hinnant added a comment.

The spec does not allow `year_month_day_last::day()` to crash.  It must not assert.  It must not index an array out of bounds.  It must not cause undefined behavior.

For example in my example implementation:  `(2020_y/month{13}/last).day() == 29_d`

I recommend a check that `month().ok()` prior to using it as an index.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70346/new/

https://reviews.llvm.org/D70346





More information about the libcxx-commits mailing list