unused var; remove test case that has undefined behavior

This commit is contained in:
Daniel Marjamäki 2021-05-13 21:53:06 +02:00
parent 1def0d797b
commit fd31f0846e
1 changed files with 1 additions and 9 deletions

View File

@ -2607,15 +2607,7 @@ private:
" char *ptr = buf;\n"
" *(ptr++) = 0;\n"
"}");
// TODO ASSERT_EQUALS("[test.cpp:5]: (style) Variable 'buf' is assigned a value that is never used.\n", errout.str());
functionVariableUsage("void foo()\n"
"{\n"
" char buf[5];\n"
" char *ptr = buf - 1;\n"
" *(++ptr) = 0;\n"
"}");
ASSERT_EQUALS("[test.cpp:3]: (style) Variable 'buf' is not assigned a value.\n", errout.str());
TODO_ASSERT_EQUALS("[test.cpp:5]: (style) Variable 'buf' is assigned a value that is never used.\n", "", errout.str());
// #3910
functionVariableUsage("void foo() {\n"