From fe131b8f9b02072d84a9a20bd10aa26aad9a2563 Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Tue, 14 Jan 2025 11:35:09 +0100 Subject: [PATCH] Update testother.cpp --- test/testother.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/testother.cpp b/test/testother.cpp index f96a917c55e..25998f61300 100644 --- a/test/testother.cpp +++ b/test/testother.cpp @@ -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()); }