This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/47913] [C++0x] improve ratio_add to overflow less often


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47913

--- Comment #13 from Marc Glisse <marc.glisse at normalesup dot org> 2011-03-02 14:05:23 UTC ---
(In reply to comment #11)
> Thanks for the attachment. Do you have a small testcase for it? I would test
> here, commit, and then we can proceed with more serious changes for post 4.6...

constexpr intmax_t m=(intmax_t)1<<(4*sizeof(intmax_t)-1);
ratio_add<ratio<1,(m-1)*(m-2)>,ratio<1,(m-3)*(m-2)> >

fails with the current libstdc++, works with the small patch, works with boost.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]