From dc051f077d0828355eb8104fd39df5d5c907622a Mon Sep 17 00:00:00 2001 From: Martin Ettl Date: Wed, 30 Sep 2015 21:55:32 +0200 Subject: [PATCH] #6667: Added a regression test to testgarbage. --- test/testgarbage.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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"