Skip to content

Commit bb98ccf

Browse files
committed
Ticket #9313 - Added a regression test
1 parent 6b5df68 commit bb98ccf

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

test/testuninitvar.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3588,6 +3588,12 @@ class TestUninitVar : public TestFixture {
35883588
" }\n"
35893589
"}");
35903590
TODO_ASSERT_EQUALS("error", "", errout.str());
3591+
3592+
valueFlowUninit("void f ( void ){\n" // #9313 - FN
3593+
" int *p;\n"
3594+
" int a[ 2 ] = { [ 0 ] = *p++, [ 1 ] = 1 };\n"
3595+
"}");
3596+
ASSERT_EQUALS("[test.cpp:3]: (error) Uninitialized variable: p\n", errout.str());
35913597
}
35923598

35933599
void uninitStructMember() { // struct members

0 commit comments

Comments
 (0)