Fixed #678 (False positive: Unused private function produced by inner class)

This commit is contained in:
Daniel Marjamäki 2009-09-25 20:42:22 +02:00
parent fe3c8cab9f
commit fd311e3c72
2 changed files with 26 additions and 0 deletions

View File

@ -541,6 +541,13 @@ void CheckClass::privateFunctions()
FuncList.push_back(tok);
}
}
/** @todo embedded class have access to private functions */
if (tok->str() == "class")
{
FuncList.clear();
break;
}
}
// Check that all private functions are used..

View File

@ -266,6 +266,25 @@ private:
" { }\n"
"};\n");
ASSERT_EQUALS("", errout.str());
check("class A\n"
"{\n"
"public:\n"
" A()\n"
" { }\n"
"\n"
"private:\n"
" void f()\n"
" { }\n"
"\n"
" class B\n"
" {\n"
" public:\n"
" B(A *a)\n"
" { a->f(); }\n"
" };\n"
"};\n");
ASSERT_EQUALS("", errout.str());
}