diff --git a/test/testnullpointer.cpp b/test/testnullpointer.cpp index 08979b54a..f2037be13 100644 --- a/test/testnullpointer.cpp +++ b/test/testnullpointer.cpp @@ -75,6 +75,7 @@ private: TEST_CASE(nullpointer33); TEST_CASE(nullpointer34); TEST_CASE(nullpointer35); + TEST_CASE(nullpointer36); // #9264 TEST_CASE(nullpointer_addressOf); // address of TEST_CASE(nullpointerSwitch); // #2626 TEST_CASE(nullpointer_cast); // #4692 @@ -1427,6 +1428,18 @@ private: ASSERT_EQUALS("", errout.str()); } + void nullpointer36() { + check("char* f(char* s) {\n" + " char* start = s;\n" + " if (!s)\n" + " return (s);\n" + " while (isspace(*start))\n" + " start++;\n" + " return (start);\n" + "}\n", true); + ASSERT_EQUALS("", errout.str()); + } + void nullpointer_addressOf() { // address of check("void f() {\n" " struct X *x = 0;\n"