Skip to content

Commit cfc3e94

Browse files
committed
add test
1 parent 3deb36d commit cfc3e94

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

test/testunusedvar.cpp

Lines changed: 11 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,16 @@ 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() {\n"
4081+
" auto a{ S() };\n"
4082+
" auto const &b{ S() };\n"
4083+
" const auto &&c{ S() };\n"
4084+
"}\n");
4085+
ASSERT_EQUALS("", errout_str());
4086+
}
4087+
40774088
void localvarloops() {
40784089
// loops
40794090
functionVariableUsage("void fun(int c) {\n"

0 commit comments

Comments
 (0)