We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 735831f commit f5109dfCopy full SHA for f5109df
1 file changed
test/testunusedvar.cpp
@@ -6574,6 +6574,25 @@ class TestUnusedVar : public TestFixture {
6574
" return 0;\n"
6575
"}\n");
6576
ASSERT_EQUALS("[test.cpp:2]: (style) Unused variable: a\n", errout.str());
6577
+
6578
+ functionVariableUsage("void f() {\n" // #9823
6579
+ " auto cb = []() {\n"
6580
+ " int i;\n"
6581
+ " };\n"
6582
+ " (void)cb;\n"
6583
+ "}\n");
6584
+ ASSERT_EQUALS("[test.cpp:3]: (style) Unused variable: i\n", errout.str());
6585
6586
+ functionVariableUsage("void f() {\n" // #9822
6587
6588
6589
6590
6591
6592
6593
+ ASSERT_EQUALS("[test.cpp:2]: (style) Unused variable: i\n"
6594
+ "[test.cpp:4]: (style) Unused variable: i\n",
6595
+ errout.str());
6596
}
6597
6598
0 commit comments