diff --git a/test/testmemleak.cpp b/test/testmemleak.cpp index b13af2af1..46c176201 100644 --- a/test/testmemleak.cpp +++ b/test/testmemleak.cpp @@ -2849,6 +2849,7 @@ private: TEST_CASE(class13); TEST_CASE(class14); TEST_CASE(class15); + TEST_CASE(class16); TEST_CASE(staticvar); @@ -3147,6 +3148,28 @@ private: ASSERT_EQUALS("", errout.str()); } + void class16() // ticket 1788 + { + check("template class A\n" + "{\n" + " private:\n" + " int nn;\n" + " T *v;\n" + " public:\n" + " A(int n): nn(n), v(new T[n]) {};\n" + " ~A();\n" + "};\n" + "template A::~A()\n" + "{\n" + " delete[] (v);\n" + "}\n" + "void foo()\n" + "{\n" + " A v(1);\n" + "}\n"); + TODO_ASSERT_EQUALS("", errout.str()); + } + void staticvar() {