We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1dfc99f commit e992e9bCopy full SHA for e992e9b
1 file changed
test/testcondition.cpp
@@ -5174,6 +5174,15 @@ class TestCondition : public TestFixture {
5174
TODO_ASSERT_EQUALS("",
5175
"[test.cpp:11:14]: (style) Condition 'p->i==o' is always true [knownConditionTrueFalse]\n",
5176
errout_str());
5177
+
5178
+ check("void f(int x) {\n" // #12320
5179
+ " int a = 0, b = 0, c = 0;\n"
5180
+ " a = x;\n"
5181
+ " if (a) b = x;\n"
5182
+ " if (b) c = x;\n"
5183
+ " if (c) {}\n"
5184
+ "}\n");
5185
+ ASSERT_EQUALS("", errout_str());
5186
}
5187
5188
void alwaysTrueInfer() {
0 commit comments