From 63f6b23ef9cb0b08a7f799aeefdfceb0d7a062ef Mon Sep 17 00:00:00 2001 From: chrchr Date: Mon, 29 Nov 2021 17:19:23 +0100 Subject: [PATCH] Add todo for #9827 --- test/testnullpointer.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/testnullpointer.cpp b/test/testnullpointer.cpp index e43fd237c2e..f673ed73298 100644 --- a/test/testnullpointer.cpp +++ b/test/testnullpointer.cpp @@ -3389,6 +3389,14 @@ class TestNullPointer : public TestFixture { "[test.cpp:5]: (error) Null pointer dereference\n" "[test.cpp:6]: (error) Null pointer dereference\n" "[test.cpp:7]: (error) Null pointer dereference\n", errout.str()); + + check("std::string f() {\n" // #9827 + " char* p = NULL;\n" + " const int rc = ::g(p);\n" + " std::string s(p);\n" + " return s;\n" + "}\n", /*inconclusive*/ true); + TODO_ASSERT_EQUALS("", "[test.cpp:4]: (warning, inconclusive) Possible null pointer dereference: p\n", errout.str()); } void nullpointerStdStream() {