Test for #4573 (False positive: variableScope within if/else if)
This commit is contained in:
parent
1e550f9fdf
commit
75f69c11b7
|
@ -67,6 +67,7 @@ private:
|
|||
TEST_CASE(varScope12);
|
||||
TEST_CASE(varScope13); // variable usage in inner loop
|
||||
TEST_CASE(varScope14);
|
||||
TEST_CASE(varScope15); // #4573 if-else-if
|
||||
|
||||
TEST_CASE(oldStylePointerCast);
|
||||
TEST_CASE(invalidPointerCast);
|
||||
|
@ -847,6 +848,18 @@ private:
|
|||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
void varScope15() {
|
||||
// #4573
|
||||
varScope("void f() {\n"
|
||||
" int a,b,c;\n"
|
||||
" if (a);\n"
|
||||
" else if(b);\n"
|
||||
" else if(c);\n"
|
||||
" else;\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
void checkOldStylePointerCast(const char code[]) {
|
||||
// Clear the error buffer..
|
||||
errout.str("");
|
||||
|
|
Loading…
Reference in New Issue