]> granicus.if.org Git - clang/commitdiff
More appropriate API usage.
authorJohn McCall <rjmccall@apple.com>
Mon, 12 Oct 2009 22:25:59 +0000 (22:25 +0000)
committerJohn McCall <rjmccall@apple.com>
Mon, 12 Oct 2009 22:25:59 +0000 (22:25 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83910 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaExpr.cpp

index 7c1c62c0a0d7415672108e3c7c479a2e0f07562b..b7c2308541ded4af75b71cb0448112af5e3ad19d 100644 (file)
@@ -6290,10 +6290,8 @@ void Sema::DiagnoseAssignmentAsCondition(Expr *E) {
     return;
   }
 
-  // We want to insert before the start of the expression...
   SourceLocation Open = E->getSourceRange().getBegin();
-  // ...and one character after the end.
-  SourceLocation Close = E->getSourceRange().getEnd().getFileLocWithOffset(1);
+  SourceLocation Close = PP.getLocForEndOfToken(E->getSourceRange().getEnd());
   
   Diag(Loc, diag::warn_condition_is_assignment)
     << E->getSourceRange()