Index: test/Index/targeted-annotation.c =================================================================== --- test/Index/targeted-annotation.c +++ test/Index/targeted-annotation.c @@ -97,3 +97,9 @@ // TOP: Keyword: "int" [11:8 - 11:11] VarDecl=TopVar:11:12 // TOP: Identifier: "TopVar" [11:12 - 11:18] VarDecl=TopVar:11:12 // TOP: Punctuation: ";" [11:18 - 11:19] + +// RUN: env CINDEXTEST_FAILONERROR=1 c-index-test -test-annotate-tokens=%S/targeted-top.h:11:12:11:18 %s -include %t.h \ +// RUN: | FileCheck %s -check-prefix=CHECK + +// CHECK: Identifier: "TopVar" [11:12 - 11:18] VarDecl=TopVar:11:12 +// CHECK-NOT: Punctuation: ";" [11:18 - 11:19] Index: tools/libclang/CIndex.cpp =================================================================== --- tools/libclang/CIndex.cpp +++ tools/libclang/CIndex.cpp @@ -6156,7 +6156,7 @@ } CXTokens.push_back(CXTok); previousWasAt = Tok.is(tok::at); - } while (Lex.getBufferLocation() <= EffectiveBufferEnd); + } while (Lex.getBufferLocation() < EffectiveBufferEnd); } void clang_tokenize(CXTranslationUnit TU, CXSourceRange Range,