Skip to content

Commit ffcbdfe

Browse files
committed
Add test for 14479
1 parent a5db405 commit ffcbdfe

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

test/testunusedvar.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ class TestUnusedVar : public TestFixture {
154154
TEST_CASE(localvar69);
155155
TEST_CASE(localvar70);
156156
TEST_CASE(localvar71);
157+
TEST_CASE(localvar72);
157158
TEST_CASE(localvarloops); // loops
158159
TEST_CASE(localvaralias1);
159160
TEST_CASE(localvaralias2); // ticket #1637
@@ -4046,6 +4047,15 @@ class TestUnusedVar : public TestFixture {
40464047
ASSERT_EQUALS("", errout_str());
40474048
}
40484049

4050+
void localvar72() {
4051+
functionVariableUsage("void f()\n"
4052+
"{\n"
4053+
" struct S {};\n"
4054+
" int S::* mp;\n"
4055+
"}\n");
4056+
ASSERT_EQUALS("[test.cpp:4:12]: (style) Unused variable: mp [unusedVariable]\n", errout_str());
4057+
}
4058+
40494059
void localvarloops() {
40504060
// loops
40514061
functionVariableUsage("void fun(int c) {\n"

0 commit comments

Comments
 (0)