Add regression test for #9028 (#2343)

Ticket #9028 was fixed in 5800692fa1, add a test case where the
class definition is seen.
This commit is contained in:
Rikard Falkeborn 2019-11-10 08:28:46 +01:00 committed by Daniel Marjamäki
parent 11319a397a
commit 2d326c011d
1 changed files with 9 additions and 0 deletions

View File

@ -428,6 +428,15 @@ private:
" std::string *str = new std::string;"
"}", true);
TODO_ASSERT_EQUALS("[test.cpp:2]: (error) Memory leak: str\n", "", errout.str());
check("class TestType {\n" // #9028
"public:\n"
" char ca[12];\n"
"};\n"
"void f() {\n"
" TestType *tt = new TestType();\n"
"}", true);
ASSERT_EQUALS("[test.cpp:7]: (error) Memory leak: tt\n", errout.str());
}
void realloc1() {