Skip to content

Commit

Permalink
Add test for #11653
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github committed Nov 29, 2023
1 parent 048591f commit c4af80b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/testclass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6621,6 +6621,17 @@ class TestClass : public TestFixture {
ASSERT_EQUALS("[test.cpp:3]: (style, inconclusive) Technically the member function 'S::f' can be const.\n"
"[test.cpp:8]: (performance, inconclusive) Technically the member function 'S::g' can be static (but you may consider moving to unnamed namespace).\n",
errout.str());

checkConst("class C {\n" // #11653
"public:\n"
" void f(bool b) const;\n"
"};\n"
"void C::f(bool b) const {\n"
" if (b)\n"
" f(false);\n"
"}\n");
ASSERT_EQUALS("[test.cpp:5] -> [test.cpp:3]: (performance, inconclusive) Technically the member function 'C::f' can be static (but you may consider moving to unnamed namespace).\n",
errout.str());
}

void const90() { // #11637
Expand Down

0 comments on commit c4af80b

Please sign in to comment.