DeclBase::getLocation() gives better location than getLocStart()
It usually points to the declaration name rather than its start. Change-Id: Idcb068ed88a783c177ae9dc255595afa0a163a7e
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user