Kaydet (Commit) 2acc59ea authored tarafından Luboš Luňák's avatar Luboš Luňák

DeclBase::getLocation() gives better location than getLocStart()

It usually points to the declaration name rather than its start.

Change-Id: Idcb068ed88a783c177ae9dc255595afa0a163a7e
üst ceb06a8f
......@@ -33,7 +33,7 @@ class Plugin
inline
bool Plugin::ignoreLocation( const Decl* decl )
{
return ignoreLocation( decl->getLocStart());
return ignoreLocation( decl->getLocation());
}
inline
......
......@@ -87,11 +87,11 @@ bool UnusedVariableCheck::VisitNamedDecl( NamedDecl* declaration )
if( !func->doesThisDeclarationHaveABody())
return true;
report( DiagnosticsEngine::Warning, "unused parameter %0 [loplugin]",
var->getLocStart()) << var->getDeclName();
var->getLocation()) << var->getDeclName();
}
else
report( DiagnosticsEngine::Warning, "unused variable %0 [loplugin]",
var->getLocStart()) << var->getDeclName();
var->getLocation()) << var->getDeclName();
}
}
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