Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions test/testunusedvar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ class TestUnusedVar : public TestFixture {
TEST_CASE(localvar70);
TEST_CASE(localvar71);
TEST_CASE(localvar72);
TEST_CASE(localvar73);
TEST_CASE(localvarloops); // loops
TEST_CASE(localvaralias1);
TEST_CASE(localvaralias2); // ticket #1637
Expand Down Expand Up @@ -4074,6 +4075,12 @@ class TestUnusedVar : public TestFixture {
ASSERT_EQUALS("[test.cpp:4:12]: (style) Unused variable: mp [unusedVariable]\n", errout_str());
}

void localvar73() {
functionVariableUsage("struct S { S(); ~S(); };\n"
"void f() { auto s{ S() }; }\n");
Comment thread
ludviggunne marked this conversation as resolved.
ASSERT_EQUALS("", errout_str());
}

void localvarloops() {
// loops
functionVariableUsage("void fun(int c) {\n"
Expand Down
Loading