You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test/testnullpointer.cpp
+9Lines changed: 9 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -3742,6 +3742,15 @@ class TestNullPointer : public TestFixture {
3742
3742
" return 1 ? 1 : *(int*)0 = 1;\n"
3743
3743
"}\n");
3744
3744
ASSERT_EQUALS("", errout_str());
3745
+
3746
+
check ("struct S {\n"// #13220
3747
+
" explicit S(int* p) : i(*p) {\n"
3748
+
" if (p) {}\n"
3749
+
" }\n"
3750
+
" int i;\n"
3751
+
"};\n");
3752
+
ASSERT_EQUALS("[test.cpp:3:13] -> [test.cpp:2:29]: (warning) Either the condition 'p' is redundant or there is possible null pointer dereference: p. [nullPointerRedundantCheck]\n",
0 commit comments