Skip to content

Commit bae3f47

Browse files
committed
add test
1 parent 1444cd8 commit bae3f47

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

test/testunusedvar.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ class TestUnusedVar : public TestFixture {
156156
TEST_CASE(localvar70);
157157
TEST_CASE(localvar71);
158158
TEST_CASE(localvar72);
159+
TEST_CASE(localvar73);
159160
TEST_CASE(localvarloops); // loops
160161
TEST_CASE(localvaralias1);
161162
TEST_CASE(localvaralias2); // ticket #1637
@@ -4074,6 +4075,12 @@ class TestUnusedVar : public TestFixture {
40744075
ASSERT_EQUALS("[test.cpp:4:12]: (style) Unused variable: mp [unusedVariable]\n", errout_str());
40754076
}
40764077

4078+
void localvar73() {
4079+
functionVariableUsage("struct S { S(); ~S(); };\n"
4080+
"void f() { auto s{ S() }; }\n");
4081+
ASSERT_EQUALS("", errout_str());
4082+
}
4083+
40774084
void localvarloops() {
40784085
// loops
40794086
functionVariableUsage("void fun(int c) {\n"

0 commit comments

Comments
 (0)