From c74282c2585028b2ab22436d97877e70ca6db5f8 Mon Sep 17 00:00:00 2001 From: Dmitry-Me Date: Fri, 29 Jan 2016 11:09:25 +0300 Subject: [PATCH] Test for signed char index in positive values range --- test/testcharvar.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/testcharvar.cpp b/test/testcharvar.cpp index 6fb3c2adc..9dc31d202 100644 --- a/test/testcharvar.cpp +++ b/test/testcharvar.cpp @@ -77,6 +77,14 @@ private: "}"); ASSERT_EQUALS("[test.cpp:5]: (warning) Signed 'char' type used as array index.\n", errout.str()); + check("int buf[256];\n" + "void foo()\n" + "{\n" + " signed char ch = 0;\n" + " buf[ch] = 0;\n" + "}"); + ASSERT_EQUALS("", errout.str()); + check("int buf[256];\n" "void foo(signed char ch)\n" "{\n"