[libcxx-commits] [libcxx] 45f81e9 - [libc++] Validates valid weekday indexed range.

Mark de Wever via libcxx-commits libcxx-commits at lists.llvm.org
Tue Nov 1 12:21:03 PDT 2022


Author: Mark de Wever
Date: 2022-11-01T20:20:57+01:00
New Revision: 45f81e904f20e761743b4a1a16c5e31fe820149c

URL: https://github.com/llvm/llvm-project/commit/45f81e904f20e761743b4a1a16c5e31fe820149c
DIFF: https://github.com/llvm/llvm-project/commit/45f81e904f20e761743b4a1a16c5e31fe820149c.diff

LOG: [libc++] Validates valid weekday indexed range.

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

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

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D137015

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/libcxx/docs/Status/Cxx20Issues.csv b/libcxx/docs/Status/Cxx20Issues.csv
index cd0c3363bf1ca..7298163085855 100644
--- a/libcxx/docs/Status/Cxx20Issues.csv
+++ b/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|"

diff  --git a/libcxx/test/std/time/time.cal/time.cal.wdidx/time.cal.wdidx.members/index.pass.cpp b/libcxx/test/std/time/time.cal/time.cal.wdidx/time.cal.wdidx.members/index.pass.cpp
index 2c3beb482a61d..cfcc21487e379 100644
--- a/libcxx/test/std/time/time.cal/time.cal.wdidx/time.cal.wdidx.members/index.pass.cpp
+++ b/libcxx/test/std/time/time.cal/time.cal.wdidx/time.cal.wdidx.members/index.pass.cpp
@@ -29,7 +29,8 @@ int main(int, char**)
 
     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);


        


More information about the libcxx-commits mailing list