libstdc++: Fix custom clock in test
authorJonathan Wakely <jwakely@redhat.com>
Thu, 22 Oct 2020 19:28:10 +0000 (20:28 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Thu, 22 Oct 2020 22:14:13 +0000 (23:14 +0100)
This test fails in C++20 mode because std::is_clock is false for the
test clock, because it doesn't define a duration member.

libstdc++-v3/ChangeLog:

* testsuite/30_threads/condition_variable/members/68519.cc:
Define recent_epoch_float_clock::duration to meet the Cpp17Clock
requirements.

libstdc++-v3/testsuite/30_threads/condition_variable/members/68519.cc

index c86ca2ccdbfc0c9a6e1cc09cc050ba43fd6cff7e..307dccd7183e2b182db6f2e60dbd61c94332c9b0 100644 (file)
@@ -47,10 +47,11 @@ test_wait_for()
 // needs to use a more recent epoch.
 struct recent_epoch_float_clock
 {
-  using rep = std::chrono::duration<float>::rep;
-  using period = std::chrono::duration<float>::period;
-  using time_point = std::chrono::time_point<recent_epoch_float_clock,
-    std::chrono::duration<float>>;
+  using duration = std::chrono::duration<float>;
+  using rep = duration::rep;
+  using period = duration::period;
+  using time_point
+    = std::chrono::time_point<recent_epoch_float_clock, duration>;
   static constexpr bool is_steady = true;
 
   static const std::chrono::steady_clock::time_point epoch;