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
const ErrorMessage errmsg(std::move(locationList), emptyString, Severity::style, "$symbol:" + funcname + "\nThe function '$symbol' should have static linkage since it is not used outside of its translation unit.", "staticFunction", Certainty::normal);
@@ -820,6 +821,21 @@ class TestUnusedFunctions : public TestFixture {
820
821
check("[[maybe_unused]] void f() {}\n");
821
822
ASSERT_EQUALS("", errout_str());
822
823
}
824
+
825
+
voidstaticFunction()
826
+
{
827
+
check("void f(void) {}\n"
828
+
"int main() {\n"
829
+
" f();\n"
830
+
"}\n");
831
+
ASSERT_EQUALS("", errout_str());
832
+
833
+
check("void f(void) {}\n"
834
+
"int main() {\n"
835
+
" f();\n"
836
+
"}\n", Platform::Type::Native, nullptr, false);
837
+
ASSERT_EQUALS("[test.c:1]: (style) The function 'f' should have static linkage since it is not used outside of its translation unit.\n", errout_str());
0 commit comments