You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit fe38e25
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: test/testother.cpp
+21Lines changed: 21 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -2284,6 +2284,27 @@ class TestOther : public TestFixture {
2284
2284
" bar(y);\n"
2285
2285
"}");
2286
2286
ASSERT_EQUALS("[test.cpp:7] -> [test.cpp:10]: (warning) Variable 'y' is reassigned a value before the old one has been used. 'break;' missing?\n", errout.str());
2287
+
2288
+
check("bool f() {\n"
2289
+
" bool ret = false;\n"
2290
+
" switch (switchCond) {\n"
2291
+
" case 1:\n"
2292
+
" ret = true;\n"
2293
+
" break;\n"
2294
+
" case 31:\n"
2295
+
" ret = true;\n"
2296
+
" break;\n"
2297
+
" case 54:\n"
2298
+
" ret = true;\n"
2299
+
" break;\n"
2300
+
" };\n"
2301
+
" ret = true;\n"
2302
+
" return ret;\n"
2303
+
"}");
2304
+
ASSERT_EQUALS("[test.cpp:5] -> [test.cpp:14]: (style) Variable 'ret' is reassigned a value before the old one has been used.\n"
2305
+
"[test.cpp:8] -> [test.cpp:14]: (style) Variable 'ret' is reassigned a value before the old one has been used.\n"
2306
+
"[test.cpp:11] -> [test.cpp:14]: (style) Variable 'ret' is reassigned a value before the old one has been used.\n",
0 commit comments