File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 "
You can’t perform that action at this time.
0 commit comments