Skip to content

Commit dddc7c8

Browse files
Update testunusedvar.cpp
1 parent f7de7d8 commit dddc7c8

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎test/testunusedvar.cpp‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3370,6 +3370,14 @@ class TestUnusedVar : public TestFixture {
33703370
" return a;\n"
33713371
"}\n");
33723372
ASSERT_EQUALS("[test.cpp:5:14]: (style) Variable 'b[c]' is assigned a value that is never used. [unreadVariable]\n", errout_str());
3373+
3374+
functionVariableUsage("int f() {\n" // #14769
3375+
" int i = 2;\n"
3376+
" const int *a, *c;\n"
3377+
" a = c = &i;\n"
3378+
" return *a;\n"
3379+
"}\n");
3380+
ASSERT_EQUALS("[test.cpp:4:11]: (style) Variable 'c' is assigned a value that is never used. [unreadVariable]\n", errout_str());
33733381
}
33743382

33753383
void localvar24() { // ticket #1803

0 commit comments

Comments
 (0)