Testcase for #4683 added (which got fixed already)

This commit is contained in:
Alexander Mai 2015-07-24 06:06:31 +02:00
parent e95800bed4
commit ed74a3dcc6
1 changed files with 15 additions and 0 deletions

View File

@ -67,6 +67,7 @@ private:
TEST_CASE(uninitvar_unconditionalTry);
TEST_CASE(uninitvar_funcptr); // #6404
TEST_CASE(uninitvar_operator); // #6680
TEST_CASE(uninitvar_ternaryexpression); // #4683
TEST_CASE(syntax_error); // Ticket #5073
@ -3767,6 +3768,20 @@ private:
ASSERT_EQUALS("", errout.str());
}
void uninitvar_ternaryexpression() { // #4683
checkUninitVar("struct B { int asd; };\n"
"int f() {\n"
" int a=0;\n"
" struct B *b;\n"
" if (x) {\n"
" a = 1;\n"
" b = p;\n"
" }\n"
" return a ? b->asd : 0;\n"
"}");
ASSERT_EQUALS("", errout.str());
}
void syntax_error() { // Ticket #5073
// Nominal mode => No output
checkUninitVar("struct flex_array {};\n"