From: John McCall Date: Wed, 6 Apr 2011 01:50:22 +0000 (+0000) Subject: Fix getLocForEndOfToken to not double-count spurious internal characters X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=77ebb3829f2abb9be2d40927b793b72347626aad;p=clang Fix getLocForEndOfToken to not double-count spurious internal characters within a token, like trigraphs and escaped newlines. Patch by Marcin Kowalczyk! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128978 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Lex/Lexer.cpp b/lib/Lex/Lexer.cpp index 6f3d611fb0..34b16c7477 100644 --- a/lib/Lex/Lexer.cpp +++ b/lib/Lex/Lexer.cpp @@ -674,7 +674,7 @@ SourceLocation Lexer::getLocForEndOfToken(SourceLocation Loc, unsigned Offset, else return Loc; - return AdvanceToTokenCharacter(Loc, Len, SM, Features); + return Loc.getFileLocWithOffset(Len); } //===----------------------------------------------------------------------===//