This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/47913] [C++0x] improve ratio_add to overflow less often
- From: "marc.glisse at normalesup dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 2 Mar 2011 14:05:35 +0000
- Subject: [Bug libstdc++/47913] [C++0x] improve ratio_add to overflow less often
- Auto-submitted: auto-generated
- References: <bug-47913-4@http.gcc.gnu.org/bugzilla/>
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.