Skip to content

Commit cdf6835

Browse files
committed
Merge pull request #769 from Dmitry-Me/testNoWarningWhenCharIndexInRange
Test for signed char index in positive values range
2 parents c7f5ca7 + c74282c commit cdf6835

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

test/testcharvar.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,14 @@ class TestCharVar : public TestFixture {
7777
"}");
7878
ASSERT_EQUALS("[test.cpp:5]: (warning) Signed 'char' type used as array index.\n", errout.str());
7979

80+
check("int buf[256];\n"
81+
"void foo()\n"
82+
"{\n"
83+
" signed char ch = 0;\n"
84+
" buf[ch] = 0;\n"
85+
"}");
86+
ASSERT_EQUALS("", errout.str());
87+
8088
check("int buf[256];\n"
8189
"void foo(signed char ch)\n"
8290
"{\n"

0 commit comments

Comments
 (0)