Skip to content

Commit

Permalink
Update testunusedfunctions.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github committed Jul 4, 2024
1 parent 0ccc846 commit 1064957
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/testunusedfunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class TestUnusedFunctions : public TestFixture {

TEST_CASE(includes);
TEST_CASE(virtualFunc);
TEST_CASE(parensInit);
}

#define check(...) check_(__FILE__, __LINE__, __VA_ARGS__)
Expand Down Expand Up @@ -735,6 +736,17 @@ class TestUnusedFunctions : public TestFixture {
"}\n");
ASSERT_EQUALS("", errout_str());
}

void parensInit()
{
check("struct S {\n" // #12898
" void url() {}\n"
"};\n"
"int main() {\n"
" const int url(0);\n"
"}\n");
ASSERT_EQUALS("[test.cpp:2]: (style) The function 'url' is never used.\n", errout_str());
}
};

REGISTER_TEST(TestUnusedFunctions)

0 comments on commit 1064957

Please sign in to comment.