add TODO for pathological case

This commit is contained in:
Greg Hewgill 2011-03-04 19:22:17 +13:00
parent 70fcbe94f4
commit 8e839a46e8
1 changed files with 21 additions and 0 deletions

View File

@ -1393,6 +1393,27 @@ private:
" }\n"
"}\n");
ASSERT_EQUALS("", errout.str());
check_preprocess_suppress(
"void foo() {\n"
" switch (a) {\n"
" case 1:\n"
" g();\n"
" switch (b) {\n"
" case 1:\n"
" return;\n"
" default:\n"
" return;\n"
" }\n"
" case 2:\n"
" break;\n"
" }\n"
"}\n");
// This fails because the switch parsing code currently doesn't understand
// that all paths after g() actually return. It's a pretty unusual case
// (no pun intended).
TODO_ASSERT_EQUALS("",
"[test.cpp:11]: (warning) Switch falls through case without comment\n", errout.str());
}
void selfAssignment()