Skip to content

Commit 11d003c

Browse files
Update testother.cpp
1 parent 15a4f63 commit 11d003c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/testother.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11032,6 +11032,15 @@ class TestOther : public TestFixture {
1103211032
" a = x;\n"
1103311033
"}\n");
1103411034
ASSERT_EQUALS("", errout_str());
11035+
11036+
check("int f(int a, int b, int c) {\n" // #4491
11037+
" int x = a + b;\n"
11038+
" if (c)\n"
11039+
" x = a + b;\n"
11040+
" return x;\n"
11041+
"}\n");
11042+
ASSERT_EQUALS("[test.cpp:2:11] -> [test.cpp:4:9]: (style) Variable 'x' is assigned an expression that holds the same value. [redundantAssignment]\n",
11043+
errout_str());
1103511044
}
1103611045

1103711046
void varFuncNullUB() { // #4482

0 commit comments

Comments
 (0)