Re: [PATCH] PR libstdc++/70664 Set failbit and read zero on stream reading negative value into unsigned type

2018-03-13 Thread Jonathan Wakely
On 13 March 2018 at 15:55, Jean-Baptiste Daval wrote: > Hi, > > Currently when a value is extracted from a stream into a unsigned type, > there is no test to check if the value is negative, in which case there > is an overflow and failbit is not set (the correct behavior would be to > read a zero a

[PATCH] PR libstdc++/70664 Set failbit and read zero on stream reading negative value into unsigned type

2018-03-13 Thread Jean-Baptiste Daval
Hi, Currently when a value is extracted from a stream into a unsigned type, there is no test to check if the value is negative, in which case there is an overflow and failbit is not set (the correct behavior would be to read a zero and set failbit). This patch add a condition to check when we are