You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test/testunusedfunctions.cpp
+11Lines changed: 11 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -86,6 +86,7 @@ class TestUnusedFunctions : public TestFixture {
86
86
TEST_CASE(attributeUnused);
87
87
TEST_CASE(attributeMaybeUnused);
88
88
TEST_CASE(staticFunction);
89
+
TEST_CASE(unnamedArg);
89
90
}
90
91
91
92
structCheckOptions
@@ -827,6 +828,16 @@ class TestUnusedFunctions : public TestFixture {
827
828
"}\n", dinit(CheckOptions, $.cpp = false));
828
829
ASSERT_EQUALS("[test.c:1:6]: (style) The function 'f' should have static linkage since it is not used outside of its translation unit. [staticFunction]\n", errout_str());
829
830
}
831
+
832
+
voidunnamedArg()
833
+
{
834
+
check("struct S {\n"
835
+
" void Type() {}\n"
836
+
"};\n"
837
+
"[[unused]] void f(Type) {}\n"
838
+
"[[unused]] void g(Type, Type) {}\n");
839
+
ASSERT_EQUALS("[test.cpp:2:10]: (style) The function 'Type' is never used. [unusedFunction]\n", errout_str());
0 commit comments