loplugin:staticmethods

Change-Id: I33a8ca28b0c3bf1c31758d93238e74927bebde9c
This commit is contained in:
Noel Grandin
2015-04-09 08:45:51 +02:00
parent b5f5a38650
commit 26ec80f47d
36 changed files with 128 additions and 179 deletions

View File

@@ -142,7 +142,12 @@ bool StaticMethods::TraverseCXXMethodDecl(const CXXMethodDecl * pCXXMethodDecl)
{
return true;
}
std::string fqn = aParentName + "::" + pCXXMethodDecl->getNameAsString();
// only empty on Linux, not on windows
if (fqn == "OleEmbeddedObject::GetVisualRepresentationInNativeFormat_Impl"
|| fqn == "OleEmbeddedObject::GetRidOfComponent") {
return true;
}
bVisitedThis = false;
TraverseStmt(pCXXMethodDecl->getBody());
@@ -152,7 +157,7 @@ bool StaticMethods::TraverseCXXMethodDecl(const CXXMethodDecl * pCXXMethodDecl)
report(
DiagnosticsEngine::Warning,
"this method can be declared static " + aParentName,
"this method can be declared static " + fqn,
pCXXMethodDecl->getCanonicalDecl()->getLocStart())
<< pCXXMethodDecl->getCanonicalDecl()->getSourceRange();
return true;