http://llvm.org/bugs/show_bug.cgi?id=19354
Bug ID: 19354
Summary: failed stream extraction consumes characters after
clear (libstdc++ vs libc++)
Product: libc++
Version: unspecified
Hardware: Macintosh
OS: MacOS X
Status: NEW
Severity: normal
Priority: P
Component: All Bugs
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
Thought I would report the following difference between libstdc++ and libc++.
For the code below, libc++ reports a position (ss.tellg()) of 3, whereas
libstdc++ reports 0.
#include <iostream>
#include <sstream>
int main()
{
std::stringstream ss;
double f;
ss << "abc";
ss >> f;
if(ss.fail()) {
std::cout << "Failed!" << std::endl;
ss.clear();
}
std::cout << "Position: " << ss.tellg() << std::endl;
}
--
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