Skip to content

Commit 8025a29

Browse files
committed
add test
1 parent 174a569 commit 8025a29

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

test/testfunctions.cpp

Lines changed: 8 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,13 @@ 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+
check("boost::asio::awaitable<void> test() {\n"
1933+
" co_return;\n"
1934+
"}\n");
1935+
ASSERT_EQUALS("", errout_str());
1936+
}
1937+
19301938
void checkMissingReturnStdInt() {// #14482 - FN
19311939
check("std::int32_t f() {}\n");
19321940
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)