From 5d7ebadf25ea7d5b4b17baab2ee50d92e0525090 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Tue, 27 Aug 2013 15:57:38 +0200 Subject: [PATCH] =?UTF-8?q?Fixed=20=C2=A44596=20(False=20positive,=20Varia?= =?UTF-8?q?ble=20'value'=20is=20not=20assigned=20a=20value=20(x=20=3D=20x?= =?UTF-8?q?=20>>=20value))?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/testunusedvar.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/testunusedvar.cpp b/test/testunusedvar.cpp index fe8f5bc22..0409945b7 100644 --- a/test/testunusedvar.cpp +++ b/test/testunusedvar.cpp @@ -1640,6 +1640,21 @@ private: " if (c >>= x) {}\n" "}"); ASSERT_EQUALS("", errout.str()); + + functionVariableUsage("void f() {\n" + " int x;\n" + " C c;\n" + " if (c >>= x) {}\n" + "}", "test.c"); + TODO_ASSERT_EQUALS("[test.c:2]: (style) Variable 'x' is not assigned a value.\n", + "[test.c:2]: (style) Variable 'x' is not assigned a value.\n" + "[test.c:3]: (style) Variable 'c' is not assigned a value.\n", errout.str()); + + functionVariableUsage("void f(int c) {\n" + " int x;\n" + " if (c >> x) {}\n" + "}"); + TODO_ASSERT_EQUALS("[test.c:2]: (style) Variable 'x' is not assigned a value.\n", "", errout.str()); } void localvar33() { // ticket #2345