diff --git a/test/testleakautovar.cpp b/test/testleakautovar.cpp index 2dc5f1d0c6f..476850e8c9b 100644 --- a/test/testleakautovar.cpp +++ b/test/testleakautovar.cpp @@ -428,6 +428,15 @@ class TestLeakAutoVar : public TestFixture { " 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() {