http://llvm.org/bugs/show_bug.cgi?id=15445
Bug ID: 15445
Summary: istream fails to parse long numeric string correctly
Product: libc++
Version: unspecified
Hardware: PC
OS: Linux
Status: NEW
Severity: release blocker
Priority: P
Component: All Bugs
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
The following code fails as reading stops on the '+' character (but that's not
the bug, removing the '+' from the string still causes it to fail).
#include <sstream>
#include <cassert>
int main(int argc, char** argv)
{
std::stringstream ss;
ss <<
"3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651e+10";
long double d;
ss >> d;
//char c = ss.get();
assert(ss.rdbuf()->in_avail() == 0);
return 0;
}
The rational for wanting to do this, is that we have both numeric constants and
test data expressed as a string - sometimes this is read into a multiprecision
type, and sometimes into a native type.
The failure is with SVN Trunk BTW.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs