We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b564fdd commit f97bab8Copy full SHA for f97bab8
1 file changed
test/testleakautovar.cpp
@@ -3203,6 +3203,14 @@ class TestLeakAutoVarStrcpy : public TestFixture {
3203
" p->f();\n"
3204
"}");
3205
ASSERT_EQUALS("[test.cpp:9]: (error) Memory leak: p\n", errout.str());
3206
+
3207
+ check("class B { std::string s; };\n" // #12062
3208
+ "class D : public B {};\n"
3209
+ "void g() {\n"
3210
+ " auto d = new D();\n"
3211
+ " if (d) {}\n"
3212
+ "}\n");
3213
+ ASSERT_EQUALS("[test.cpp:6]: (error) Memory leak: d\n", errout.str());
3214
}
3215
};
3216
0 commit comments