diff --git a/libcxx/include/__config b/libcxx/include/__config --- a/libcxx/include/__config +++ b/libcxx/include/__config @@ -814,12 +814,20 @@ # endif #endif -#ifndef _LIBCPP_HAS_NO_NOEXCEPT -# define _NOEXCEPT noexcept -# define _NOEXCEPT_(x) noexcept(x) -#else -# define _NOEXCEPT throw() -# define _NOEXCEPT_(x) +#ifndef _NOEXCEPT +# ifndef _LIBCPP_HAS_NO_NOEXCEPT +# define _NOEXCEPT noexcept +# else +# define _NOEXCEPT throw() +# endif +#endif + +#ifndef _NOEXCEPT_ +# ifndef _LIBCPP_HAS_NO_NOEXCEPT +# define _NOEXCEPT_(x) noexcept(x) +# else +# define _NOEXCEPT_(x) +# endif #endif #ifdef _LIBCPP_HAS_NO_UNICODE_CHARS 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 @@ -2438,14 +2440,14 @@ inline constexpr chrono::year year() const noexcept { return __y; } inline constexpr chrono::month month() const noexcept { return __mdl.month(); } inline constexpr chrono::month_day_last month_day_last() const noexcept { return __mdl; } - constexpr chrono::day day() const noexcept; + constexpr chrono::day day() const _NOEXCEPT; inline constexpr operator sys_days() const noexcept { return sys_days{year()/month()/day()}; } inline explicit constexpr operator local_days() const noexcept { return local_days{year()/month()/day()}; } inline constexpr bool ok() const noexcept { return __y.ok() && __mdl.ok(); } }; inline constexpr -chrono::day year_month_day_last::day() const noexcept +chrono::day year_month_day_last::day() const _NOEXCEPT { constexpr chrono::day __d[] = { @@ -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,6 +14,10 @@ // __debug_less checks that a comparator actually provides a strict-weak ordering. +// indirectly includes which uses _LIBCPP_ASSERT in a method mareked _NOEXCEPT, +// but throwing is not allowed in a function marked noexcept, so we define _NOEXCEPT to nothing. +#define _NOEXCEPT + struct DebugException {}; #define _LIBCPP_DEBUG 0 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