lopluign:staticmethods: Improve diagnostics
Change-Id: I6079f387a697c5fe794655e455a19d0cb44b96bc
This commit is contained in:
@@ -201,8 +201,15 @@ bool StaticMethods::TraverseCXXMethodDecl(const CXXMethodDecl * pCXXMethodDecl)
|
|||||||
report(
|
report(
|
||||||
DiagnosticsEngine::Warning,
|
DiagnosticsEngine::Warning,
|
||||||
"this method can be declared static " + fqn,
|
"this method can be declared static " + fqn,
|
||||||
pCXXMethodDecl->getCanonicalDecl()->getLocStart())
|
pCXXMethodDecl->getCanonicalDecl()->getLocation())
|
||||||
<< pCXXMethodDecl->getCanonicalDecl()->getSourceRange();
|
<< pCXXMethodDecl->getCanonicalDecl()->getSourceRange();
|
||||||
|
FunctionDecl const * def;
|
||||||
|
if (pCXXMethodDecl->isDefined(def)
|
||||||
|
&& def != pCXXMethodDecl->getCanonicalDecl())
|
||||||
|
{
|
||||||
|
report(DiagnosticsEngine::Note, "defined here:", def->getLocation())
|
||||||
|
<< def->getSourceRange();
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user