[PATCH] PR libstdc++/59568 fix error handling for std::complex stream extraction
Jonathan Wakely
jwakely@redhat.com
Thu Dec 14 11:28:00 GMT 2017
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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 2026 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20171214/b28de3c7/attachment.bin>
More information about the Libstdc++
mailing list