diff --git a/test/testgarbage.cpp b/test/testgarbage.cpp index f234be320..b05c426f9 100644 --- a/test/testgarbage.cpp +++ b/test/testgarbage.cpp @@ -166,6 +166,7 @@ private: TEST_CASE(garbageCode124); // 6948 TEST_CASE(garbageCode125); // 6782, 6834 TEST_CASE(garbageCode126); // #6997 + TEST_CASE(garbageCode127); // #6667 TEST_CASE(garbageValueFlow); TEST_CASE(garbageSymbolDatabase); @@ -952,6 +953,18 @@ private: InternalError); } + void garbageCode127() { // #6667 + checkCode("extern \"C\" int printf(const char* fmt, ...);\n" + "class A {\n" + "public:\n" + " int Var;\n" + " A(int arg) { Var = arg; }\n" + " ~A() { printf(\"A d'tor\\n\"); }\n" + "};\n" + " const A& foo(const A& arg) { return arg; }\n" + " foo(A(12)).Var\n"); + } + void garbageValueFlow() { // #6089 const char* code = "{} int foo(struct, x1, struct x2, x3, int, x5, x6, x7)\n"