Fixed #678 (False positive: Unused private function produced by inner class)
This commit is contained in:
parent
fe3c8cab9f
commit
fd311e3c72
|
@ -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..
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue