Re: [PATCH] Change std::ceil2 to be undefined if the result can't be represented

2019-07-22 Thread Jonathan Wakely
On 25/06/19 10:40 +0100, Jonathan Wakely wrote: * include/std/bit (__ceil2): Make unrepresentable results undefined, as per P1355R2. Add debug assertion. Perform one left shift, not two, so that out of range values cause undefined behaviour. Ensure that shift will

[PATCH] Change std::ceil2 to be undefined if the result can't be represented

2019-06-25 Thread Jonathan Wakely
* include/std/bit (__ceil2): Make unrepresentable results undefined, as per P1355R2. Add debug assertion. Perform one left shift, not two, so that out of range values cause undefined behaviour. Ensure that shift will still be undefined if left operand is promoted.