Skip to content

Commit 5b2fbea

Browse files
committed
add test
1 parent 174a569 commit 5b2fbea

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

test/testfunctions.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ class TestFunctions : public TestFixture {
8686
TEST_CASE(checkMissingReturn5);
8787
TEST_CASE(checkMissingReturn6); // #13180
8888
TEST_CASE(checkMissingReturn7); // #14370 - FN try/catch
89+
TEST_CASE(checkMissingReturn8);
8990
TEST_CASE(checkMissingReturnStdInt); // #14482 - FN std::int32_t
9091

9192
// std::move for locar variable
@@ -1927,6 +1928,14 @@ class TestFunctions : public TestFixture {
19271928
ASSERT_EQUALS("[test.cpp:3:19]: (error) Found an exit path from function with non-void return type that has missing return statement [missingReturn]\n", errout_str());
19281929
}
19291930

1931+
void checkMissingReturn8() {
1932+
const Settings s = settingsBuilder(settings).cpp(Standards::CPP20).build();
1933+
check("boost::asio::awaitable<void> test() {\n"
1934+
" co_return;\n"
1935+
"}\n",s);
1936+
ASSERT_EQUALS("", errout_str());
1937+
}
1938+
19301939
void checkMissingReturnStdInt() {// #14482 - FN
19311940
check("std::int32_t f() {}\n");
19321941
ASSERT_EQUALS("[test.cpp:1:19]: (error) Found an exit path from function with non-void return type that has missing return statement [missingReturn]\n", errout_str());

0 commit comments

Comments
 (0)