[libcxx-commits] [libcxx] Use `LIBCPP_STATIC_ASSERT` in chrono test (PR #132566)
Mark de Wever via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Mar 24 10:13:38 PDT 2025
================
@@ -30,7 +30,7 @@ int main(int, char**)
static_assert((std::is_same<C::rep, C::duration::rep>::value), "");
static_assert((std::is_same<C::period, C::duration::period>::value), "");
static_assert((std::is_same<C::duration, C::time_point::duration>::value), "");
- static_assert(C::is_steady || !C::is_steady, "");
+ static_assert(std::is_same<decltype(C::is_steady), const bool>::value, "");
test(std::chrono::high_resolution_clock::is_steady);
----------------
mordante wrote:
The `is_steady` tests whether the clock is steady. This means the clock has no time jumps. For some clocks the Standard requires them to be steady, for others it's implementation defined. The [[time.clock]](http://eel.is/c++draft/time.clock#utc.nonmembers) has the information. When _unspecified_ we need a `LIBCPP_ASSERT` to validate the value libc++ uses.
https://github.com/llvm/llvm-project/pull/132566
More information about the libcxx-commits
mailing list