<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - num_get::do_get(in, end, double) broken if double is followed by character"
   href="http://llvm.org/bugs/show_bug.cgi?id=17782">17782</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>num_get::do_get(in, end, double) broken if double is followed by character
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libc++
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>All Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>hhinnant@apple.com
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>stephan.aiche@googlemail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=11475" name="attach_11475" title="Test program documenting the problem.">attachment 11475</a> <a href="attachment.cgi?id=11475&action=edit" title="Test program documenting the problem.">[details]</a></span>
Test program documenting the problem.

When extracting doubles from stringstream the character following the double
affects if extraction works or not (see attached code example). If the double
is followed by a space or underscore extraction works, if a letter follows
extraction fails. It seems to be related to the extraction of the double
performed by num_get::do_get().

If I read the standard correctly (ISO/IEC 14882:2003(E), 22.2.2.1.2 num_get
virtual functions [lib.facet.num.get.virtuals]; sorry no 2011 at hand) this
should work independently of the character following the double.

Tested with:

$ c++ --version
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.0
Thread model: posix

Steps to reproduce:

1. Compile the attached test program (c++ --stdlib=libc++ streamtest.cxx)
2. Run the attached test program

Actual result:

'-4.9' converted to -4.9
'-4.9 X' converted to -4.9
'-4.9_' converted to -4.9
'-4.9d' failed to convert to double
'-4.9X' failed to convert to double

Expected result: (produced with c++ --stdlib=libstdc++ streamtest.cxx)

'-4.9' converted to -4.9
'-4.9 X' converted to -4.9
'-4.9_' converted to -4.9
'-4.9d' converted to -4.9
'-4.9X' converted to -4.9

Build Date & Platform: 2013-11-01 on Mac OS 10.9</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>