[libcxx-commits] [libcxx] r363589 - Add tests for LWG 3206. NFC
Marshall Clow via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Jun 17 11:06:31 PDT 2019
Author: marshall
Date: Mon Jun 17 11:06:30 2019
New Revision: 363589
URL: http://llvm.org/viewvc/llvm-project?rev=363589&view=rev
Log:
Add tests for LWG 3206. NFC
Modified:
libcxx/trunk/test/std/utilities/time/time.cal/time.cal.ymd/time.cal.ymd.members/op.sys_days.pass.cpp
libcxx/trunk/www/upcoming_meeting.html
Modified: libcxx/trunk/test/std/utilities/time/time.cal/time.cal.ymd/time.cal.ymd.members/op.sys_days.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/time/time.cal/time.cal.ymd/time.cal.ymd.members/op.sys_days.pass.cpp?rev=363589&r1=363588&r2=363589&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/time/time.cal/time.cal.ymd/time.cal.ymd.members/op.sys_days.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/time/time.cal/time.cal.ymd/time.cal.ymd.members/op.sys_days.pass.cpp Mon Jun 17 11:06:30 2019
@@ -90,5 +90,28 @@ int main(int, char**)
assert( year_month_day{sd} == ymd); // and back
}
+// These two tests check the wording for LWG 3206
+ {
+ constexpr year_month_day ymd{year{1971}, month{1}, day{0}}; // bad day
+ static_assert(!ymd.ok(), "");
+ static_assert( ymd.year().ok(), "");
+ static_assert( ymd.month().ok(), "");
+ static_assert(!ymd.day().ok(), "");
+ constexpr sys_days sd{ymd};
+ static_assert(sd.time_since_epoch() == days{364}, "");
+ static_assert(sd == sys_days{ymd.year()/ymd.month()/day{1}} + (ymd.day() - day{1}), "");
+ }
+
+ {
+ constexpr year_month_day ymd{year{1970}, month{12}, day{32}}; // bad day
+ static_assert(!ymd.ok(), "");
+ static_assert( ymd.year().ok(), "");
+ static_assert( ymd.month().ok(), "");
+ static_assert(!ymd.day().ok(), "");
+ constexpr sys_days sd{ymd};
+ static_assert(sd.time_since_epoch() == days{365}, "");
+ static_assert(sd == sys_days{ymd.year()/ymd.month()/day{1}} + (ymd.day() - day{1}), "");
+ }
+
return 0;
}
Modified: libcxx/trunk/www/upcoming_meeting.html
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/www/upcoming_meeting.html?rev=363589&r1=363588&r2=363589&view=diff
==============================================================================
--- libcxx/trunk/www/upcoming_meeting.html (original)
+++ libcxx/trunk/www/upcoming_meeting.html Mon Jun 17 11:06:30 2019
@@ -73,7 +73,7 @@
<tr><td><a href="https://wg21.link/LWG3198">3198</a></td><td>Yes</td><td>Bad constraint on <tt>std::span::span()</tt></td><td>Cologne</td><td>Complete</td></tr>
<tr><td><a href="https://wg21.link/LWG3199">3199</a></td><td>Yes</td><td><tt>istream >> bitset<0></tt> fails</td><td>Cologne</td><td></td></tr>
<tr><td><a href="https://wg21.link/LWG3202">3202</a></td><td>Yes</td><td>P0318R1 was supposed to be revised</td><td>Cologne</td><td>Complete</td></tr>
-<tr><td><a href="https://wg21.link/LWG3206">3206</a></td><td>Yes</td><td><tt>year_month_day</tt> conversion to <tt>sys_days</tt> uses not-existing member function</td><td>Cologne</td><td></td></tr>
+<tr><td><a href="https://wg21.link/LWG3206">3206</a></td><td>Yes</td><td><tt>year_month_day</tt> conversion to <tt>sys_days</tt> uses not-existing member function</td><td>Cologne</td><td>Complete</td></tr>
<tr><td><a href="https://wg21.link/LWG3208">3208</a></td><td>Yes</td><td><tt>Boolean</tt>'s expression requirements are ordered inconsistently</td><td>Cologne</td><td>Nothing to do</td></tr>
<tr><td><a href="https://wg21.link/LWG3209">3209</a></td><td>Yes</td><td>Expression in <tt>year::ok()</tt> returns clause is ill-formed</td><td>Cologne</td><td></td></tr>
</table>
@@ -107,7 +107,7 @@
<li>3198 - We already do this</li>
<li>3199 - Louis?</li>
<li>3202 - We already do this</li>
-<li>3206 - Marshall?</li>
+<li>3206 - We already do this; added a couple of explicit tests</li>
<li>3208 - Nothing to do; wording cleanup</li>
<li>3209 - Marshall?</li>
</ul>
More information about the libcxx-commits
mailing list