about summary refs log tree commit diff
path: root/absl/time/time.h
diff options
context:
space:
mode:
Diffstat (limited to 'absl/time/time.h')
-rw-r--r--absl/time/time.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/absl/time/time.h b/absl/time/time.h
index 0b7312ee983d..46ac26b3c0d2 100644
--- a/absl/time/time.h
+++ b/absl/time/time.h
@@ -422,7 +422,9 @@ Duration Milliseconds(T n) {
 template <typename T, time_internal::EnableIfFloat<T> = 0>
 Duration Seconds(T n) {
   if (n >= 0) {  // Note: `NaN >= 0` is false.
-    if (n >= (std::numeric_limits<int64_t>::max)()) return InfiniteDuration();
+    if (n >= static_cast<T>((std::numeric_limits<int64_t>::max)())) {
+      return InfiniteDuration();
+    }
     return time_internal::MakePosDoubleDuration(n);
   } else {
     if (std::isnan(n))