We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 15a4f63 commit 11d003cCopy full SHA for 11d003c
1 file changed
test/testother.cpp
@@ -11032,6 +11032,15 @@ class TestOther : public TestFixture {
11032
" a = x;\n"
11033
"}\n");
11034
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());
11044
}
11045
11046
void varFuncNullUB() { // #4482
0 commit comments