-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Closed
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillalibc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Description
| Bugzilla Link | 10817 |
| Resolution | FIXED |
| Resolved on | May 28, 2013 10:25 |
| Version | unspecified |
| OS | All |
| Reporter | LLVM Bugzilla Contributor |
| CC | @stbergmann |
Extended Description
The following trivial program fails to give the intended results with libc++ — instead of reading one line from the terminal, it reads two.
#include
#include
using namespace std;
int main()
{
cout << "What is your name: ";
string name;
getline(cin, name);
cout << "Hello " << name << endl;
return 0;
}
Here it is without libcxx:
% clang++ -o hello hello.cpp
% ./hello
What is your name: Miss Marple
Hello Miss Marple
... and here it is with libcxx:
% clang++ -stdlib=libc++ -o hello hello.cpp
% ./hello
What is your name: Miss Marple
... oh noes, I need to type another line ... you do test this stuff, right?
Hello Miss Marple
Tested with current trunk (138853) and with Xcode 4.1.
Metadata
Metadata
Assignees
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillalibc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.