Skip to content

Commit 08dc9ec

Browse files
committed
add test
1 parent d32c01d commit 08dc9ec

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

test/testnullpointer.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ class TestNullPointer : public TestFixture {
145145
TEST_CASE(nullpointer105); // #13861
146146
TEST_CASE(nullpointer106); // #13682
147147
TEST_CASE(nullpointer107); // #13682 (FP/FN cases around guards that depend on the pointer indirectly)
148+
TEST_CASE(nullpointer108);
148149
TEST_CASE(nullpointer_addressOf); // address of
149150
TEST_CASE(nullpointerSwitch); // #2626
150151
TEST_CASE(nullpointer_cast); // #4692
@@ -3105,6 +3106,18 @@ class TestNullPointer : public TestFixture {
31053106
ASSERT_EQUALS("", errout_str());
31063107
}
31073108

3109+
void nullpointer108()
3110+
{
3111+
check("boost::asio::awaitable<int> test()\n"
3112+
"{\n"
3113+
" const auto *s = getStr();\n"
3114+
" if(!s) co_return int{1};\n"
3115+
" std::print(\"{}\",*s);\n"
3116+
" co_return int{9};\n"
3117+
"}\n");
3118+
ASSERT_EQUALS("", errout_str());
3119+
}
3120+
31083121
void nullpointer_addressOf() { // address of
31093122
check("void f() {\n"
31103123
" struct X *x = 0;\n"

0 commit comments

Comments
 (0)