diff --git a/libcxx/include/chrono b/libcxx/include/chrono --- a/libcxx/include/chrono +++ b/libcxx/include/chrono @@ -830,6 +830,8 @@ #include #include +#include <__debug> + #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif @@ -2454,6 +2456,7 @@ chrono::day(31), chrono::day(31), chrono::day(30), chrono::day(31), chrono::day(30), chrono::day(31) }; + _LIBCPP_ASSERT(ok(), "year_month_day_last::day(): year_month_day_last is invalid"); return month() != February || !__y.is_leap() ? __d[static_cast(month()) - 1] : chrono::day{29}; } diff --git a/libcxx/test/libcxx/algorithms/debug_less.pass.cpp b/libcxx/test/libcxx/algorithms/debug_less.pass.cpp --- a/libcxx/test/libcxx/algorithms/debug_less.pass.cpp +++ b/libcxx/test/libcxx/algorithms/debug_less.pass.cpp @@ -14,8 +14,13 @@ // __debug_less checks that a comparator actually provides a strict-weak ordering. +#include // Include before defining _LIBCPP_ASSERT: cannot throw in a function marked noexcept. + struct DebugException {}; +#ifdef _LIBCPP_ASSERT +#undef _LIBCPP_ASSERT +#endif #define _LIBCPP_DEBUG 0 #define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : throw ::DebugException()) diff --git a/libcxx/www/cxx2a_status.html b/libcxx/www/cxx2a_status.html --- a/libcxx/www/cxx2a_status.html +++ b/libcxx/www/cxx2a_status.html @@ -439,7 +439,7 @@ 3209Expression in year::ok() returns clause is ill-formedCologneComplete - 3231year_month_day_last::day specification does not cover !ok() valuesBelfast + 3231year_month_day_last::day specification does not cover !ok() valuesBelfastNothing to do 3225zoned_time converting constructor shall not be noexceptBelfast 3190std::allocator::allocate sometimes returns too little storageBelfast 3218Modifier for %d parse flag does not match POSIX and format specificationBelfast