Skip to content

Commit 51a19dd

Browse files
Update testunusedvar.cpp
1 parent 0820249 commit 51a19dd

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

test/testunusedvar.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5813,6 +5813,22 @@ class TestUnusedVar : public TestFixture {
58135813
" {}\n"
58145814
"}");
58155815
ASSERT_EQUALS("", errout_str());
5816+
5817+
functionVariableUsage("void f(const int* b, int x) {\n" // #11125
5818+
" int a[6];\n"
5819+
" int i = 0;\n"
5820+
" for (int j = 0; j < 6; ++j) {\n"
5821+
" if (b[j] != 0) {\n"
5822+
" a[i] = j;\n"
5823+
" ++i;\n"
5824+
" }\n"
5825+
" }\n"
5826+
" if (i > 1) {\n"
5827+
" a[i] = a[0];\n"
5828+
" (void)a[x];\n"
5829+
" }\n"
5830+
"}\n");
5831+
ASSERT_EQUALS("", errout_str());
58165832
}
58175833

58185834
void localvarForEach() { // #4155 - foreach

0 commit comments

Comments
 (0)