Fix issue 7836: Add regression test (#2308)
This commit is contained in:
parent
02c0240dcd
commit
02150e741d
|
@ -4272,6 +4272,15 @@ private:
|
|||
" if (a) {}\n"
|
||||
"}");
|
||||
ASSERT_EQUALS("[test.cpp:8]: (error) Uninitialized variable: a\n", errout.str());
|
||||
|
||||
valueFlowUninit("void test(int p) {\n"
|
||||
" int f;\n"
|
||||
" if (p > 0)\n"
|
||||
" f = 0;\n"
|
||||
" if (p > 1)\n"
|
||||
" f += 1;\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
void uninitvar_ipa() {
|
||||
|
|
Loading…
Reference in New Issue