#4750 Added a regression test
This commit is contained in:
parent
185a5e1ee6
commit
e23a967215
|
@ -133,6 +133,7 @@ private:
|
|||
TEST_CASE(array_index_50);
|
||||
TEST_CASE(array_index_51); // #3763
|
||||
TEST_CASE(array_index_52); // #7682
|
||||
TEST_CASE(array_index_53); // #4750
|
||||
TEST_CASE(array_index_multidim);
|
||||
TEST_CASE(array_index_switch_in_for);
|
||||
TEST_CASE(array_index_for_in_for); // FP: #2634
|
||||
|
@ -1546,6 +1547,18 @@ private:
|
|||
ASSERT_EQUALS("[test.cpp:5]: (error) Array 'buf[10]' accessed at index 10, which is out of bounds.\n", errout.str());
|
||||
}
|
||||
|
||||
void array_index_53() {
|
||||
check("double M[3][1];\n"
|
||||
" \n"
|
||||
"void matrix()\n"
|
||||
"{\n"
|
||||
" for (int i=0; i < 3; i++)\n"
|
||||
" for (int j = 0; j < 3; j++)\n"
|
||||
" M[i][j]=0.0;\n"
|
||||
"}");
|
||||
ASSERT_EQUALS("[test.cpp:7]: (error) Array 'M[3][1]' accessed at index M[*][2], which is out of bounds.\n", errout.str());
|
||||
}
|
||||
|
||||
void array_index_multidim() {
|
||||
check("void f()\n"
|
||||
"{\n"
|
||||
|
|
Loading…
Reference in New Issue