#3838 added another testcase to avoid a FP.

This commit is contained in:
Ettl Martin 2013-03-14 09:21:31 +01:00
parent 8f2ca7c9d0
commit 19c430530f
1 changed files with 9 additions and 0 deletions

View File

@ -1488,6 +1488,15 @@ private:
"var[0].var[ 2 ] = 2;\n" "var[0].var[ 2 ] = 2;\n"
"}"); "}");
ASSERT_EQUALS("", errout.str()); ASSERT_EQUALS("", errout.str());
// avoid FP (example taken from #3838)
check("struct AB { int a[10]; int b[10]; };\n"
"int main() {\n"
" struct AB ab;\n"
" int * p = &ab[0].a[10]; \n"
" return 0;\n"
"}\n");
ASSERT_EQUALS("", errout.str());
} }
void array_index_44() { // #3979 (false positive) void array_index_44() { // #3979 (false positive)