| 1 |
// RUN: %clang_analyze_cc1 -analyzer-checker=core,unix,debug.ExprInspection -verify %s |
| 2 |
|
| 3 |
// RUN: %clang_analyze_cc1 -analyzer-checker=core,unix,alpha.unix,debug.ExprInspection -verify %s |
| 4 |
// |
| 5 |
// expected-no-diagnostics |
| 6 |
|
| 7 |
#include "Inputs/system-header-simulator-cxx.h" |
| 8 |
|
| 9 |
void test_std_getline() { |
| 10 |
std::string userid, comment; |
| 11 |
// MallocChecker should not confuse the POSIX function getline() and the |
| 12 |
// unrelated C++ standard library function std::getline. |
| 13 |
std::getline(std::cin, userid, ' '); // no-crash |
| 14 |
std::getline(std::cin, comment); // no-crash |
| 15 |
} |