[PATCH] PR libstdc++/59568 fix error handling for std::complex stream extraction

Jonathan Wakely jwakely@redhat.com
Thu Dec 14 11:48:00 GMT 2017

On 14/12/17 11:28 +0000, Jonathan Wakely wrote:
>On 13/12/17 18:42 +0000, Jonathan Wakely wrote:
>>The bug here is that we called putback even if the initial __is >> __ch
>>extraction failed and set eofbit, and putback clears the eofbit. I
>>found a number of other problems though, such as not even trying to
>>call putback after failing to find the ',' and ')' characters.
>>I decided to rewrite the function following the proposed resolution
>>for https://wg21.link/lwg2714 which is a much more precise
>>specification for much more desirable semantics.
>>	PR libstdc++/59568
>>	* include/std/complex (operator>>): Implement proposed resolution to
>>	LWG 2714. Use putback if and only if a character has been successfully
>>	extracted but isn't a delimiter. Use ctype::widen and traits::eq when
>>	testing if extracted characters match delimiters.
>>	* testsuite/26_numerics/complex/dr2714.cc: New test.
>>Tested powerpc64le-linux, committed to trunk.
>Here's a tweak for the testcase. Tested x86_64-linux, committed to trunk.

And an extra test for whitespace handling. Committed to trunk.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 1375 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20171214/6f6d9aa8/attachment.bin>

More information about the Libstdc++ mailing list