[libcxx-commits] [libcxx] Use `LIBCPP_STATIC_ASSERT` in chrono test (PR #132566)
via libcxx-commits
libcxx-commits at lists.llvm.org
Sat Mar 22 14:33:31 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libcxx
Author: None (PaulXiCao)
<details>
<summary>Changes</summary>
Closes #<!-- -->132546.
---
Full diff: https://github.com/llvm/llvm-project/pull/132566.diff
3 Files Affected:
- (modified) libcxx/test/std/time/time.clock/time.clock.gps/types.compile.pass.cpp (+5-6)
- (modified) libcxx/test/std/time/time.clock/time.clock.tai/types.compile.pass.cpp (+5-6)
- (modified) libcxx/test/std/time/time.clock/time.clock.utc/types.compile.pass.cpp (+5-6)
``````````diff
diff --git a/libcxx/test/std/time/time.clock/time.clock.gps/types.compile.pass.cpp b/libcxx/test/std/time/time.clock/time.clock.gps/types.compile.pass.cpp
index 006ad9a2d243e..81604b6e8be7f 100644
--- a/libcxx/test/std/time/time.clock/time.clock.gps/types.compile.pass.cpp
+++ b/libcxx/test/std/time/time.clock/time.clock.gps/types.compile.pass.cpp
@@ -36,11 +36,10 @@
#include "test_macros.h"
// class gps_clock
-using rep = std::chrono::gps_clock::rep;
-using period = std::chrono::gps_clock::period;
-using duration = std::chrono::gps_clock::duration;
-using time_point = std::chrono::gps_clock::time_point;
-[[maybe_unused]] constexpr bool is_steady = std::chrono::gps_clock::is_steady;
+using rep = std::chrono::gps_clock::rep;
+using period = std::chrono::gps_clock::period;
+using duration = std::chrono::gps_clock::duration;
+using time_point = std::chrono::gps_clock::time_point;
// Tests the values. part of them are implementation defined.
LIBCPP_STATIC_ASSERT(std::same_as<rep, std::chrono::utc_clock::rep>);
@@ -52,7 +51,7 @@ static_assert(std::same_as<period, std::ratio<period::num, period::den>>);
static_assert(std::same_as<duration, std::chrono::duration<rep, period>>);
static_assert(std::same_as<time_point, std::chrono::time_point<std::chrono::gps_clock>>);
-LIBCPP_STATIC_ASSERT(is_steady == false);
+LIBCPP_STATIC_ASSERT(std::chrono::gps_clock::is_steady == false);
// typedefs
static_assert(std::same_as<std::chrono::gps_time<int>, std::chrono::time_point<std::chrono::gps_clock, int>>);
diff --git a/libcxx/test/std/time/time.clock/time.clock.tai/types.compile.pass.cpp b/libcxx/test/std/time/time.clock/time.clock.tai/types.compile.pass.cpp
index a7123bc3e0b5c..b411b1a13acf6 100644
--- a/libcxx/test/std/time/time.clock/time.clock.tai/types.compile.pass.cpp
+++ b/libcxx/test/std/time/time.clock/time.clock.tai/types.compile.pass.cpp
@@ -36,11 +36,10 @@
#include "test_macros.h"
// class tai_clock
-using rep = std::chrono::tai_clock::rep;
-using period = std::chrono::tai_clock::period;
-using duration = std::chrono::tai_clock::duration;
-using time_point = std::chrono::tai_clock::time_point;
-[[maybe_unused]] constexpr bool is_steady = std::chrono::tai_clock::is_steady;
+using rep = std::chrono::tai_clock::rep;
+using period = std::chrono::tai_clock::period;
+using duration = std::chrono::tai_clock::duration;
+using time_point = std::chrono::tai_clock::time_point;
// Tests the values. part of them are implementation defined.
LIBCPP_STATIC_ASSERT(std::same_as<rep, std::chrono::utc_clock::rep>);
@@ -52,7 +51,7 @@ static_assert(std::same_as<period, std::ratio<period::num, period::den>>);
static_assert(std::same_as<duration, std::chrono::duration<rep, period>>);
static_assert(std::same_as<time_point, std::chrono::time_point<std::chrono::tai_clock>>);
-LIBCPP_STATIC_ASSERT(is_steady == false);
+LIBCPP_STATIC_ASSERT(std::chrono::tai_clock::is_steady == false);
// typedefs
static_assert(std::same_as<std::chrono::tai_time<int>, std::chrono::time_point<std::chrono::tai_clock, int>>);
diff --git a/libcxx/test/std/time/time.clock/time.clock.utc/types.compile.pass.cpp b/libcxx/test/std/time/time.clock/time.clock.utc/types.compile.pass.cpp
index 8cb3d78d97f52..292e2c47c02b6 100644
--- a/libcxx/test/std/time/time.clock/time.clock.utc/types.compile.pass.cpp
+++ b/libcxx/test/std/time/time.clock/time.clock.utc/types.compile.pass.cpp
@@ -36,11 +36,10 @@
#include "test_macros.h"
// class utc_clock
-using rep = std::chrono::utc_clock::rep;
-using period = std::chrono::utc_clock::period;
-using duration = std::chrono::utc_clock::duration;
-using time_point = std::chrono::utc_clock::time_point;
-[[maybe_unused]] constexpr bool is_steady = std::chrono::utc_clock::is_steady;
+using rep = std::chrono::utc_clock::rep;
+using period = std::chrono::utc_clock::period;
+using duration = std::chrono::utc_clock::duration;
+using time_point = std::chrono::utc_clock::time_point;
// Tests the values. Some of them are implementation-defined.
LIBCPP_STATIC_ASSERT(std::same_as<rep, std::chrono::system_clock::rep>);
@@ -52,7 +51,7 @@ static_assert(std::same_as<period, std::ratio<period::num, period::den>>);
static_assert(std::same_as<duration, std::chrono::duration<rep, period>>);
static_assert(std::same_as<time_point, std::chrono::time_point<std::chrono::utc_clock>>);
-LIBCPP_STATIC_ASSERT(is_steady == false);
+LIBCPP_STATIC_ASSERT(std::chrono::utc_clock::is_steady == false);
// typedefs
static_assert(std::same_as<std::chrono::utc_time<int>, std::chrono::time_point<std::chrono::utc_clock, int>>);
``````````
</details>
https://github.com/llvm/llvm-project/pull/132566
More information about the libcxx-commits
mailing list