parent
461d797094
commit
25360d5e4c
|
@ -2237,6 +2237,16 @@ private:
|
||||||
" }\n"
|
" }\n"
|
||||||
"}");
|
"}");
|
||||||
ASSERT_EQUALS("[test.cpp:4]: (error) Array 'a[10]' accessed at index 10, which is out of bounds.\n", errout.str());
|
ASSERT_EQUALS("[test.cpp:4]: (error) Array 'a[10]' accessed at index 10, which is out of bounds.\n", errout.str());
|
||||||
|
|
||||||
|
// #7686
|
||||||
|
check("char f() {\n"
|
||||||
|
" char buf[10];\n"
|
||||||
|
" const bool a = true, b = true;\n"
|
||||||
|
" for (int i = 0; i < (a && b ? 11 : 10); ++i)\n"
|
||||||
|
" buf[i] = 0;\n"
|
||||||
|
" return buf[0];\n"
|
||||||
|
"}\n");
|
||||||
|
ASSERT_EQUALS("[test.cpp:5]: (error) Array 'buf[10]' accessed at index 10, which is out of bounds.\n", errout.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void array_index_for_neq() {
|
void array_index_for_neq() {
|
||||||
|
|
Loading…
Reference in New Issue