Fix test for #9827 (#3781)

This commit is contained in:
chrchr-github 2022-02-02 19:29:01 +01:00 committed by GitHub
parent 8cf5c8fbf2
commit 69ee464dff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -3506,11 +3506,13 @@ private:
check("std::string f() {\n" // #9827 check("std::string f() {\n" // #9827
" char* p = NULL;\n" " char* p = NULL;\n"
" const int rc = ::g(p);\n" " int r = g(p);\n"
" if (!r)\n"
" return \"\";\n"
" std::string s(p);\n" " std::string s(p);\n"
" return s;\n" " return s;\n"
"}\n", /*inconclusive*/ true); "}\n", /*inconclusive*/ true);
TODO_ASSERT_EQUALS("", "[test.cpp:4]: (warning, inconclusive) Possible null pointer dereference: p\n", errout.str()); ASSERT_EQUALS("", errout.str());
} }
void nullpointerStdStream() { void nullpointerStdStream() {