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:
Luboš Luňák
2012-10-12 15:34:14 +02:00
parent ceb06a8f09
commit 2acc59ea28
2 changed files with 3 additions and 3 deletions

View File

@@ -33,7 +33,7 @@ class Plugin
inline
bool Plugin::ignoreLocation( const Decl* decl )
{
return ignoreLocation( decl->getLocStart());
return ignoreLocation( decl->getLocation());
}
inline

View File

@@ -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;