[Bug libstdc++/61166] overflow when parse number in std::duration operator""

2014-06-23 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61166 Jonathan Wakely changed: What|Removed |Added Status|NEW |RESOLVED Resolution|---

[Bug libstdc++/61166] overflow when parse number in std::duration operator""

2014-05-16 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61166 --- Comment #13 from Jonathan Wakely --- Author: redi Date: Fri May 16 09:30:57 2014 New Revision: 210511 URL: http://gcc.gnu.org/viewcvs?rev=210511&root=gcc&view=rev Log: 2014-05-15 Ed Smith-Rowland <3dw...@verizon.net> Jonathan Wakel

[Bug libstdc++/61166] overflow when parse number in std::duration operator""

2014-05-16 Thread kan.liu.229 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61166 --- Comment #12 from Kan Liu --- (In reply to Jonathan Wakely from comment #11) > (In reply to Kan Liu from comment #10) > > _Select_type already does the overflow check, so *template implemented > > operators* is still redundant I think. > > Yo

[Bug libstdc++/61166] overflow when parse number in std::duration operator""

2014-05-16 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61166 --- Comment #11 from Jonathan Wakely --- (In reply to Kan Liu from comment #10) > _Select_type already does the overflow check, so *template implemented > operators* is still redundant I think. You can't use _Select_type on a literal operator th

[Bug libstdc++/61166] overflow when parse number in std::duration operator""

2014-05-15 Thread kan.liu.229 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61166 --- Comment #10 from Kan Liu --- (In reply to Jonathan Wakely from comment #9) > I can see one good reason to implement those operators as templates: it > allows us to check if the literal value overflows the duration::rep type, > which is requir

[Bug libstdc++/61166] overflow when parse number in std::duration operator""

2014-05-15 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61166 --- Comment #9 from Jonathan Wakely --- I can see one good reason to implement those operators as templates: it allows us to check if the literal value overflows the duration::rep type, which is required by the standard but impossible to implemen

[Bug libstdc++/61166] overflow when parse number in std::duration operator""

2014-05-14 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61166 Jonathan Wakely changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed|

[Bug libstdc++/61166] overflow when parse number in std::duration operator""

2014-05-14 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61166 --- Comment #8 from Jonathan Wakely --- That's correct, and the standard is clear that operator""ms(unsigned long long) is required to return chrono::milliseconds, not some other equivalent duration with a different Rep. So I think the question

[Bug libstdc++/61166] overflow when parse number in std::duration operator""

2014-05-14 Thread kan.liu.229 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61166 --- Comment #7 from Kan Liu --- (In reply to emsr from comment #6) > Something like parse_number was in the original doc as an implementation > example. The idea was to select the smallest integral type that could > accommodate the number string

[Bug libstdc++/61166] overflow when parse number in std::duration operator""

2014-05-14 Thread emsr at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61166 --- Comment #6 from emsr at gcc dot gnu.org --- Something like parse_number was in the original doc as an implementation example. The idea was to select the smallest integral type that could accommodate the number string with. This is done with

[Bug libstdc++/61166] overflow when parse number in std::duration operator""

2014-05-13 Thread 3dw4rd at verizon dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61166 --- Comment #5 from Ed Smith-Rowland <3dw4rd at verizon dot net> --- Created attachment 32792 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=32792&action=edit Better patch with test case. 2014-05-13 Ed Smith-Rowland <3dw...@verizon.net>

[Bug libstdc++/61166] overflow when parse number in std::duration operator""

2014-05-13 Thread kan.liu.229 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61166 --- Comment #4 from Kan Liu --- btw, is it really necessary to use functionality in parse_number.h to parse manually? What *parse_number* has done is no more than the general *operator""(unsigned long long)*, and it just enables *0b* and *0B* pre

[Bug libstdc++/61166] overflow when parse number in std::duration operator""

2014-05-13 Thread kan.liu.229 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61166 --- Comment #3 from Kan Liu --- (In reply to emsr from comment #2) > Created attachment 32789 [details] > Patch to parse_nmber to make it unsigned long long all over. > > Works on x86_64-linux. Yeah, it works. Thank you!

[Bug libstdc++/61166] overflow when parse number in std::duration operator""

2014-05-13 Thread emsr at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61166 --- Comment #2 from emsr at gcc dot gnu.org --- Created attachment 32789 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=32789&action=edit Patch to parse_nmber to make it unsigned long long all over. Works on x86_64-linux.

[Bug libstdc++/61166] overflow when parse number in std::duration operator""

2014-05-13 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61166 Paolo Carlini changed: What|Removed |Added CC|kan.liu.229 at gmail dot com |3dw4rd at verizon dot net --- Co