We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0820249 commit 51a19ddCopy full SHA for 51a19dd
1 file changed
test/testunusedvar.cpp
@@ -5813,6 +5813,22 @@ class TestUnusedVar : public TestFixture {
5813
" {}\n"
5814
"}");
5815
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
5826
+ " if (i > 1) {\n"
5827
+ " a[i] = a[0];\n"
5828
+ " (void)a[x];\n"
5829
5830
+ "}\n");
5831
+ ASSERT_EQUALS("", errout_str());
5832
}
5833
5834
void localvarForEach() { // #4155 - foreach
0 commit comments