From 7d8b62e6157bb0c44aed04f16863ee833f34c49c Mon Sep 17 00:00:00 2001 From: Alexander Mai Date: Mon, 26 Oct 2015 18:24:49 +0100 Subject: [PATCH] Add regression test for #6669 Return value of malloc is reported not stored, while it is. --- test/testother.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/testother.cpp b/test/testother.cpp index 53995bbba..a78d7c18d 100644 --- a/test/testother.cpp +++ b/test/testother.cpp @@ -6122,6 +6122,12 @@ private: " return 0;\n" "}"); ASSERT_EQUALS("", errout.str()); + + // #6669 + check("void foo(size_t size) {\n" + " void * res{malloc(size)};\n" + "}", "test.cpp", false, false, true, &settings); + ASSERT_EQUALS("", errout.str()); } void redundantPointerOp() {