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