Re: [PATCH] libstdc++: Fix arithmetic bug in year_month_weekday conversion [PR96713]

2020-10-28 Thread Patrick Palka via Gcc-patches
On Wed, 28 Oct 2020, Jonathan Wakely wrote: > On 28/10/20 11:21 -0400, Patrick Palka via Libstdc++ wrote: > > On Wed, 28 Oct 2020, Patrick Palka wrote: > > > > > The conversion function year_month_weekday::operator sys_days computes > > > the number of days to offset from the first weekday of the

Re: [PATCH] libstdc++: Fix arithmetic bug in year_month_weekday conversion [PR96713]

2020-10-28 Thread Jonathan Wakely via Gcc-patches
On 28/10/20 11:21 -0400, Patrick Palka via Libstdc++ wrote: On Wed, 28 Oct 2020, Patrick Palka wrote: The conversion function year_month_weekday::operator sys_days computes the number of days to offset from the first weekday of the month with: days{(index()-1)*7} ^ type 'un

Re: [PATCH] libstdc++: Fix arithmetic bug in year_month_weekday conversion [PR96713]

2020-10-28 Thread Jonathan Wakely via Gcc-patches
On 28/10/20 11:04 -0400, Patrick Palka via Libstdc++ wrote: The conversion function year_month_weekday::operator sys_days computes the number of days to offset from the first weekday of the month with: days{(index()-1)*7} ^ type 'unsigned' We'd like the above to yield -7d when

Re: [PATCH] libstdc++: Fix arithmetic bug in year_month_weekday conversion [PR96713]

2020-10-28 Thread Patrick Palka via Gcc-patches
On Wed, 28 Oct 2020, Patrick Palka wrote: > The conversion function year_month_weekday::operator sys_days computes > the number of days to offset from the first weekday of the month with: > > days{(index()-1)*7} > ^ type 'unsigned' > > We'd like the above to yield -7d when in

[PATCH] libstdc++: Fix arithmetic bug in year_month_weekday conversion [PR96713]

2020-10-28 Thread Patrick Palka via Gcc-patches
The conversion function year_month_weekday::operator sys_days computes the number of days to offset from the first weekday of the month with: days{(index()-1)*7} ^ type 'unsigned' We'd like the above to yield -7d when index() is 0u, but our 'days' alias is based on long instea