[libcxx-commits] [PATCH] D137015: [libc++] Validates valid weekday indexed range.

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sat Oct 29 03:30:50 PDT 2022


Mordante created this revision.
Herald added a subscriber: arphaman.
Herald added a project: All.
Mordante requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

No code changes, but only increased the range in the tests.

Completes:

- LWG3273. Specify weekday_indexed to range of [0, 7]


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D137015

Files:
  libcxx/docs/Status/Cxx20Issues.csv
  libcxx/test/std/time/time.cal/time.cal.wdidx/time.cal.wdidx.members/index.pass.cpp


Index: libcxx/test/std/time/time.cal/time.cal.wdidx/time.cal.wdidx.members/index.pass.cpp
===================================================================
--- libcxx/test/std/time/time.cal/time.cal.wdidx/time.cal.wdidx.members/index.pass.cpp
+++ libcxx/test/std/time/time.cal/time.cal.wdidx/time.cal.wdidx.members/index.pass.cpp
@@ -29,7 +29,8 @@
 
     static_assert( weekday_indexed{}.index() == 0, "");
 
-    for (unsigned i = 1; i <= 5; ++i)
+	// This is the valid range of values defined in [time.cal.wdidx.members]/1.
+    for (unsigned i = 0; i <= 7; ++i)
     {
         weekday_indexed wdi(weekday{2}, i);
         assert( static_cast<unsigned>(wdi.index()) == i);
Index: libcxx/docs/Status/Cxx20Issues.csv
===================================================================
--- libcxx/docs/Status/Cxx20Issues.csv
+++ libcxx/docs/Status/Cxx20Issues.csv
@@ -178,7 +178,7 @@
 "`3241 <https://wg21.link/LWG3241>`__","``chrono-spec``\  grammar ambiguity in |sect|\ [time.format]","Belfast","|Complete|","16.0","|chrono| |format|"
 "`3257 <https://wg21.link/LWG3257>`__","Missing feature testing macro update from P0858","Belfast","",""
 "`3256 <https://wg21.link/LWG3256>`__","Feature testing macro for ``constexpr``\  algorithms","Belfast","|Complete|","13.0"
-"`3273 <https://wg21.link/LWG3273>`__","Specify ``weekday_indexed``\  to range of ``[0, 7]``\ ","Belfast","","","|chrono|"
+"`3273 <https://wg21.link/LWG3273>`__","Specify ``weekday_indexed``\  to range of ``[0, 7]``\ ","Belfast","|Complete|","16.0","|chrono|"
 "`3070 <https://wg21.link/LWG3070>`__","``path::lexically_relative``\  causes surprising results if a filename can also be a  *root-name*","Belfast","",""
 "`3266 <https://wg21.link/LWG3266>`__","``to_chars(bool)``\  should be deleted","Belfast","|Complete|","14.0"
 "`3272 <https://wg21.link/LWG3272>`__","``%I%p``\  should parse/format ``duration``\  since midnight","Belfast","","","|chrono| |format|"


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D137015.471737.patch
Type: text/x-patch
Size: 1938 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20221029/783409f6/attachment.bin>


More information about the libcxx-commits mailing list