Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compilation failure with large duration ratios #1154

Closed
pauldreik opened this issue May 10, 2019 · 1 comment
Closed

compilation failure with large duration ratios #1154

pauldreik opened this issue May 10, 2019 · 1 comment

Comments

@pauldreik
Copy link
Contributor

pauldreik commented May 10, 2019

Hi,
the following fails to compile with the recent fixes inside chrono (the milliseconds handling), which broke compilation of the chrono fuzzer.

TEST(ChronoTest, StdChronoCompiletimeOverflowCheckLarge) {
  // this wont compile, fails on the internal overflow check                                                                                      
  // in std::ratio for libstdc++ (gnu)                                                                                                            
  using Large = std::chrono::duration<float, std::exa>;
  EXPECT_TRUE("" != fmt::format("{}", Large{1}));
}

TEST(ChronoTest, StdChronoCompiletimeOverflowCheckSmall) {
  // this works fine                                                                                                                              
  using Small = std::chrono::duration<float, std::atto>;
  EXPECT_TRUE("" != fmt::format("{}", Small{1}));
}

I am not sure what is the best route forward - it would be nice if all the standard prefixes are supported (peta works, it is only exa that doesn't).
If anyone actually uses exaseconds as their unit, it would be very interesting to hear what problem and/or domain they work with :-)

@vitaut
Copy link
Contributor

vitaut commented May 11, 2019

Fixed in de5da50, thanks for reporting.

@vitaut vitaut closed this as completed May 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants