This commit is contained in:
Ardi Nugraha 2023-11-16 11:34:56 +08:00 committed by GitHub
commit 77ea5e91f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -2088,7 +2088,7 @@ struct formatter<std::chrono::time_point<std::chrono::system_clock, Duration>,
if (subsecs.count() < 0) {
auto second =
std::chrono::duration_cast<Duration>(std::chrono::seconds(1));
if (epoch.count() < ((Duration::min)() + second).count())
if ((epoch + second).count() < ((Duration::min)() + second).count())
FMT_THROW(format_error("duration is too small"));
subsecs += second;
val -= second;

View File

@ -1002,4 +1002,4 @@ TEST(chrono_test, glibc_extensions) {
EXPECT_EQ(fmt::format("{:%_S}", d), " 3.140000");
EXPECT_EQ(fmt::format("{:%-S}", d), "3.140000");
}
}
}