reverted [1282] because some changes were committed by mistake
This commit is contained in:
parent
8c3e3faa07
commit
66c13c7173
|
@ -476,7 +476,7 @@ void CheckClass::privateFunctions()
|
||||||
|
|
||||||
// The class implementation must be available..
|
// The class implementation must be available..
|
||||||
const std::string classconstructor(classname + " :: " + classname);
|
const std::string classconstructor(classname + " :: " + classname);
|
||||||
if (tok1->fileIndex()>0 && !Token::findmatch(_tokenizer->tokens(), classconstructor.c_str()))
|
if (!Token::findmatch(_tokenizer->tokens(), classconstructor.c_str()))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Get private functions..
|
// Get private functions..
|
||||||
|
@ -549,13 +549,13 @@ void CheckClass::privateFunctions()
|
||||||
{
|
{
|
||||||
if (ftok->str() == "{")
|
if (ftok->str() == "{")
|
||||||
++indent_level;
|
++indent_level;
|
||||||
else if (ftok->str() == "}")
|
if (ftok->str() == "}")
|
||||||
{
|
{
|
||||||
if (indent_level <= 1)
|
if (indent_level <= 1)
|
||||||
break;
|
break;
|
||||||
--indent_level;
|
--indent_level;
|
||||||
}
|
}
|
||||||
else if (Token::Match(ftok, "%var% ("))
|
if (Token::Match(ftok->next(), "("))
|
||||||
{
|
{
|
||||||
// Remove function from FuncList
|
// Remove function from FuncList
|
||||||
for (std::list<const Token *>::iterator it = FuncList.begin(); it != FuncList.end(); ++it)
|
for (std::list<const Token *>::iterator it = FuncList.begin(); it != FuncList.end(); ++it)
|
||||||
|
|
|
@ -36,7 +36,6 @@ private:
|
||||||
void run()
|
void run()
|
||||||
{
|
{
|
||||||
TEST_CASE(test1);
|
TEST_CASE(test1);
|
||||||
TEST_CASE(test2);
|
|
||||||
|
|
||||||
// [ 2236547 ] False positive --style unused function, called via pointer
|
// [ 2236547 ] False positive --style unused function, called via pointer
|
||||||
TEST_CASE(func_pointer);
|
TEST_CASE(func_pointer);
|
||||||
|
@ -82,26 +81,6 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void test2()
|
|
||||||
{
|
|
||||||
check("class A {\n"
|
|
||||||
"public:\n"
|
|
||||||
" A();\n"
|
|
||||||
"\n"
|
|
||||||
" void a() const\n"
|
|
||||||
" { b(); }\n"
|
|
||||||
"private:\n"
|
|
||||||
" void b( ) const\n"
|
|
||||||
" { }\n"
|
|
||||||
"};\n"
|
|
||||||
"\n"
|
|
||||||
"A::A()\n"
|
|
||||||
"{ }\n");
|
|
||||||
ASSERT_EQUALS(std::string(""), errout.str());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue