We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0bf9b25 commit 09c92f0Copy full SHA for 09c92f0
1 file changed
test/testnullpointer.cpp
@@ -3944,6 +3944,15 @@ class TestNullPointer : public TestFixture {
3944
"void f() { std::string s = g(0L); }\n");
3945
ASSERT_EQUALS("[test.cpp:2:29]: (error) Null pointer dereference: g(0L) [nullPointer]\n",
3946
errout_str());
3947
+
3948
+ check("const char* g() { return nullptr; }\n" // #14098
3949
+ "std::string f() {\n"
3950
+ " std::string s{ g() };\n"
3951
+ " return s + std::string(g());\n"
3952
+ "}\n");
3953
+ ASSERT_EQUALS("[test.cpp:3:21]: (error) Null pointer dereference: g() [nullPointer]\n"
3954
+ "[test.cpp:4:29]: (error) Null pointer dereference: g() [nullPointer]\n",
3955
+ errout_str());
3956
}
3957
3958
void nullpointerStdStream() {
0 commit comments