diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2013-08-14 18:43:01 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2013-08-21 15:08:16 +0200 |
commit | 4f60eb885a5480832d1148205a08eafc6c50aa39 (patch) | |
tree | 89089f793bb57ebe94afd72f5aeb9d9daff612fe /compilerplugins/clang/pointertobool.cxx | |
parent | 0809d7d79295403c6b012a59b712dddb2ce92104 (diff) |
helper for getting location after current token
Given that locations often point to a (start of) token, even if it's
e.g. getLocEnd(), this should be very useful.
Change-Id: I266e4c0a234262e99158c8f495b631f54f8a5608
Diffstat (limited to 'compilerplugins/clang/pointertobool.cxx')
-rw-r--r-- | compilerplugins/clang/pointertobool.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compilerplugins/clang/pointertobool.cxx b/compilerplugins/clang/pointertobool.cxx index 238e0180b7e8..e0c69ff98099 100644 --- a/compilerplugins/clang/pointertobool.cxx +++ b/compilerplugins/clang/pointertobool.cxx @@ -73,7 +73,7 @@ bool PointerToBool::VisitImplicitCastExpr( const ImplicitCastExpr* expr ) report( DiagnosticsEngine::Warning, "pointer %0 implicitly converted to bool", expr->getLocStart()) << expr->getSubExpr()->getType() << expr->getSourceRange(); - SourceLocation endOfExpression = Lexer::getLocForEndOfToken( expr->getLocEnd(), 0, compiler.getSourceManager(), compiler.getLangOpts()); + SourceLocation endOfExpression = locationAfterToken( expr->getLocEnd()); report( DiagnosticsEngine::Note, "explicitly compare to null pointer to silence this warning", endOfExpression ) << FixItHint::CreateInsertion( endOfExpression, " != NULL" ); |