Skip to content

Commit

Permalink
Update testother.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github authored Jan 14, 2025
1 parent 38bbe46 commit fe131b8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/testother.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5794,6 +5794,18 @@ class TestOther : public TestFixture {
" return x;\n"
"}\n");
ASSERT_EQUALS("", errout_str());

check("bool f(int x, int y) {\n" // #13544
" switch (x) {\n"
" case 1: {\n"
" return y != 0;\n"
" int z = y + 5;\n"
" return z != 7;\n"
" }\n"
" }\n"
" return false;\n"
"}\n");
ASSERT_EQUALS("[test.cpp:5]: (style) Statements following 'return' will never be executed.\n", errout_str());
}


Expand Down

0 comments on commit fe131b8

Please sign in to comment.