diff options
| author | Marshall Clow <mclow.lists@gmail.com> | 2019-06-17 18:06:30 +0000 |
|---|---|---|
| committer | Marshall Clow <mclow.lists@gmail.com> | 2019-06-17 18:06:30 +0000 |
| commit | 2e550cabead6a444bfa69e6c168df99814e05e6a (patch) | |
| tree | 277c4e6a64b77dd0a537d53a60ceec055039dd85 /libcxx | |
| parent | a9191c8492abe90dfb4141610d11b0d5d0d67f5d (diff) | |
| download | bcm5719-llvm-2e550cabead6a444bfa69e6c168df99814e05e6a.tar.gz bcm5719-llvm-2e550cabead6a444bfa69e6c168df99814e05e6a.zip | |
Add tests for LWG 3206. NFC
llvm-svn: 363589
Diffstat (limited to 'libcxx')
| -rw-r--r-- | libcxx/test/std/utilities/time/time.cal/time.cal.ymd/time.cal.ymd.members/op.sys_days.pass.cpp | 23 | ||||
| -rw-r--r-- | libcxx/www/upcoming_meeting.html | 4 |
2 files changed, 25 insertions, 2 deletions
diff --git a/libcxx/test/std/utilities/time/time.cal/time.cal.ymd/time.cal.ymd.members/op.sys_days.pass.cpp b/libcxx/test/std/utilities/time/time.cal/time.cal.ymd/time.cal.ymd.members/op.sys_days.pass.cpp index a9568455085..03d3bbbc895 100644 --- a/libcxx/test/std/utilities/time/time.cal/time.cal.ymd/time.cal.ymd.members/op.sys_days.pass.cpp +++ b/libcxx/test/std/utilities/time/time.cal/time.cal.ymd/time.cal.ymd.members/op.sys_days.pass.cpp @@ -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; } diff --git a/libcxx/www/upcoming_meeting.html b/libcxx/www/upcoming_meeting.html index f5492325717..bd96fc7ab88 100644 --- a/libcxx/www/upcoming_meeting.html +++ b/libcxx/www/upcoming_meeting.html @@ -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> |

