Skip to content

Commit

Permalink
invoke undefined behaviour inside chrono
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldreik committed May 5, 2019
1 parent bac7ac4 commit 5087774
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/chrono-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -324,4 +324,8 @@ TEST(ChronoTest, DurationIsDoubleNaN) {
auto ignored=fmt::format("{:%I}",d);
}

TEST(ChronoTest, OverflowingFloat) {
const std::chrono::duration<float,std::kilo> d{std::numeric_limits<float>::max()*0.5f};
auto ignored=fmt::format("{:%I}",d);
}
#endif // FMT_STATIC_THOUSANDS_SEPARATOR

0 comments on commit 5087774

Please sign in to comment.