Kaydet (Commit) 2f28d2b4 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Improve loplugin:salcall error reporting

Change-Id: Ib18f61f10225d5499f94144c8a0f9efff40e43aa
Reviewed-on: https://gerrit.libreoffice.org/46366Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst a987aa3b
......@@ -301,11 +301,23 @@ bool SalCall::VisitFunctionDecl(FunctionDecl const* decl)
if (bOK)
return true;
report(DiagnosticsEngine::Warning, "SAL_CALL unnecessary here", rewriteLoc)
<< decl->getSourceRange();
if (bDeclIsSalCall)
{
report(DiagnosticsEngine::Warning, "SAL_CALL unnecessary here",
rewriteLoc.isValid() ? rewriteLoc : decl->getLocation())
<< decl->getSourceRange();
}
if (canonicalDecl != decl)
{
report(DiagnosticsEngine::Warning, "SAL_CALL unnecessary here", rewriteCanonicalLoc)
<< canonicalDecl->getSourceRange();
if (!bDeclIsSalCall)
{
report(DiagnosticsEngine::Note, "defined here (without SAL_CALL decoration)",
decl->getLocation())
<< decl->getSourceRange();
}
}
return true;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment