File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -75,6 +75,7 @@ class TestNullPointer : public TestFixture {
7575 TEST_CASE (nullpointer33);
7676 TEST_CASE (nullpointer34);
7777 TEST_CASE (nullpointer35);
78+ TEST_CASE (nullpointer36); // #9264
7879 TEST_CASE (nullpointer_addressOf); // address of
7980 TEST_CASE (nullpointerSwitch); // #2626
8081 TEST_CASE (nullpointer_cast); // #4692
@@ -1427,6 +1428,18 @@ class TestNullPointer : public TestFixture {
14271428 ASSERT_EQUALS (" " , errout.str ());
14281429 }
14291430
1431+ void nullpointer36 () {
1432+ check (" char* f(char* s) {\n "
1433+ " char* start = s;\n "
1434+ " if (!s)\n "
1435+ " return (s);\n "
1436+ " while (isspace(*start))\n "
1437+ " start++;\n "
1438+ " return (start);\n "
1439+ " }\n " , true );
1440+ ASSERT_EQUALS (" " , errout.str ());
1441+ }
1442+
14301443 void nullpointer_addressOf () { // address of
14311444 check (" void f() {\n "
14321445 " struct X *x = 0;\n "
You can’t perform that action at this time.
0 commit comments