Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github committed Aug 9, 2023
1 parent c99e69d commit 6d57730
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/testmemleak.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2485,6 +2485,14 @@ class TestMemleakNoVar : public TestFixture {
"}\n");
ASSERT_EQUALS("[test.cpp:3]: (error) Allocation with new, f doesn't release it.\n",
errout.str());

check("void f(int i, T t);\n"
"void g(int i, U* u);\n"
"void h() {\n"
" f(1, new int());\n"
" g(1, new int());\n"
"}\n");
ASSERT_EQUALS("", errout.str());
}

void missingAssignment() {
Expand Down

0 comments on commit 6d57730

Please sign in to comment.