We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e93fb9c commit 0faaf14Copy full SHA for 0faaf14
1 file changed
test/testcondition.cpp
@@ -4787,6 +4787,19 @@ class TestCondition : public TestFixture {
4787
" }\n"
4788
"}\n");
4789
ASSERT_EQUALS("", errout_str());
4790
+
4791
+ check("struct S {\n" // #14392
4792
+ " bool g() const { return m; }\n"
4793
+ " bool m{};\n"
4794
+ "};\n"
4795
+ "void f(S s) {\n"
4796
+ " if (s.g()) {\n"
4797
+ " bool b = s.g();\n"
4798
+ " return b;\n"
4799
+ " }\n"
4800
+ " return false;\n"
4801
+ "}\n");
4802
+ ASSERT_EQUALS("[test.cpp:6:12] -> [test.cpp:7:21]: (style) Condition 's.g()' is always true [knownConditionTrueFalse]\n", errout_str());
4803
}
4804
4805
void alwaysTrueSymbolic()
0 commit comments