https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61166
Bug ID: 61166 Summary: overflow when parse number in std::duration operator"" Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: kan.liu.229 at gmail dot com overflow may occur when using a number whose size exceeds sizeof(unsigned) in chrono_literals. Because the parse classes in include/bits/parse_number.h just use *unsigned* for member type. However, it should accept *unsigned long long* I think. This issue also exists in trunk I think. #include <chrono> using namespace std; using namespace std::chrono; int main() { // std::numeric_limits<unsigned>::max() == 4294967295 cout << 429496729510 << endl; cout << (429496729510h).count() << endl; return 0; } And the result is 429496729510 926648584