1 parent 916c809 commit a1eca64Copy full SHA for a1eca64
1 file changed
test/testcondition.cpp
@@ -5503,6 +5503,13 @@ class TestCondition : public TestFixture {
5503
" std::size_t x;\n"
5504
"};\n");
5505
ASSERT_EQUALS("", errout_str());
5506
+
5507
+ check("int g();\n" // #13441
5508
+ "void f() {\n"
5509
+ " int (*p)() = g;\n"
5510
+ " if (p == nullptr) {}\n"
5511
+ "};\n");
5512
+ ASSERT_EQUALS("[test.cpp:4:11]: (style) Condition 'p==nullptr' is always false [knownConditionTrueFalse]\n", errout_str());
5513
}
5514
5515
void alwaysTrueContainer() {
0 commit comments