File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -198,6 +198,7 @@ class TestUnusedVar : public TestFixture {
198198 TEST_CASE (localvarreturn); // ticket #9167
199199 TEST_CASE (localvarmaybeunused);
200200 TEST_CASE (localvarrvalue); // ticket #13977
201+ TEST_CASE (localvarreferencearray); // ticket #14637
201202
202203 TEST_CASE (localvarthrow); // ticket #3687
203204
@@ -6554,6 +6555,16 @@ class TestUnusedVar : public TestFixture {
65546555 ASSERT_EQUALS (" [test.cpp:3:21]: (style) Variable 'm' is assigned a value that is never used. [unreadVariable]\n " , errout_str ());
65556556 }
65566557
6558+ void localvarreferencearray () { // ticket #14637
6559+ functionVariableUsage (" int f() {\n "
6560+ " int a[1];\n "
6561+ " int(&r)[1] = a;\n "
6562+ " r[0] = 0;\n "
6563+ " return r[0];\n "
6564+ " }\n " );
6565+ ASSERT_EQUALS (" " , errout_str ());
6566+ }
6567+
65576568 void localvarthrow () { // ticket #3687
65586569 functionVariableUsage (" void foo() {\n "
65596570 " try {}"
You can’t perform that action at this time.
0 commit comments