diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2012-10-12 15:34:14 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2012-10-12 16:56:53 +0200 |
commit | 2acc59ea28d7cabbef9b91d379f03ab6877596bf (patch) | |
tree | b43f703c1477c9e6fdd792f6cbf6df80f1330f4a | |
parent | ceb06a8f0906dd9bd7aa69b121a050eb4dcc861e (diff) |
DeclBase::getLocation() gives better location than getLocStart()
It usually points to the declaration name rather than its start.
Change-Id: Idcb068ed88a783c177ae9dc255595afa0a163a7e
-rw-r--r-- | compilerplugins/clang/compileplugin.hxx | 2 | ||||
-rw-r--r-- | compilerplugins/clang/unusedvariablecheck.cxx | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/compilerplugins/clang/compileplugin.hxx b/compilerplugins/clang/compileplugin.hxx index a02b36005e4b..6c854d1e0179 100644 --- a/compilerplugins/clang/compileplugin.hxx +++ b/compilerplugins/clang/compileplugin.hxx @@ -33,7 +33,7 @@ class Plugin inline bool Plugin::ignoreLocation( const Decl* decl ) { - return ignoreLocation( decl->getLocStart()); + return ignoreLocation( decl->getLocation()); } inline diff --git a/compilerplugins/clang/unusedvariablecheck.cxx b/compilerplugins/clang/unusedvariablecheck.cxx index 7d9a170153ca..b6b867dec89c 100644 --- a/compilerplugins/clang/unusedvariablecheck.cxx +++ b/compilerplugins/clang/unusedvariablecheck.cxx @@ -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; |