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 c86ca2c..307dccd 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;