Ticket #9313 - Added a regression test

This commit is contained in:
orbitcowboy 2022-04-26 07:45:08 +02:00
parent 6b5df68677
commit bb98ccf7d4
1 changed files with 6 additions and 0 deletions

View File

@ -3588,6 +3588,12 @@ private:
" }\n"
"}");
TODO_ASSERT_EQUALS("error", "", errout.str());
valueFlowUninit("void f ( void ){\n" // #9313 - FN
" int *p;\n"
" int a[ 2 ] = { [ 0 ] = *p++, [ 1 ] = 1 };\n"
"}");
ASSERT_EQUALS("[test.cpp:3]: (error) Uninitialized variable: p\n", errout.str());
}
void uninitStructMember() { // struct members