#8196: Added a regression test
This commit is contained in:
parent
27a4df06d2
commit
1f411498b6
|
@ -2952,6 +2952,13 @@ private:
|
||||||
|
|
||||||
void alwaysTrue() {
|
void alwaysTrue() {
|
||||||
|
|
||||||
|
check("void f(const struct S *s) {\n" //#8196
|
||||||
|
" int x1 = s->x;\n"
|
||||||
|
" int x2 = s->x;\n"
|
||||||
|
" if (x1 == 10 && x2 == 10) {}\n" // <<
|
||||||
|
"}");
|
||||||
|
ASSERT_EQUALS("[test.cpp:4] -> [test.cpp:4]: (style) Condition 'x2==10' is always true\n", errout.str());
|
||||||
|
|
||||||
check("void f ()\n"// #8220
|
check("void f ()\n"// #8220
|
||||||
"{\n"
|
"{\n"
|
||||||
" int a;\n"
|
" int a;\n"
|
||||||
|
|
Loading…
Reference in New Issue