llvm-project/clang/unittests/Lex
Richard Smith b5f8171a1b PR37189 Fix incorrect end source location and spelling for a split '>>' token.
When a '>>' token is split into two '>' tokens (in C++11 onwards), or (as an
extension) when we do the same for other tokens starting with a '>', we can't
just use a location pointing to the first '>' as the location of the split
token, because that would result in our miscomputing the length and spelling
for the token. As a consequence, for example, a refactoring replacing 'A<X>'
with something else would sometimes replace one character too many, and
similarly diagnostics highlighting a template-id source range would highlight
one character too many.

Fix this by creating an expansion range covering the first character of the
'>>' token, whose spelling is '>'. For this to work, we generalize the
expansion range of a macro FileID to be either a token range (the common case)
or a character range (used in this new case).

llvm-svn: 331155
2018-04-30 05:25:48 +00:00
..
CMakeLists.txt [Lexer] Support adding working directory to relative search dir for #include shortening in HeaderSearch. 2018-01-29 13:21:23 +00:00
HeaderMapTest.cpp Lex: Return "" when HeaderMap::lookupFilename fails 2016-02-23 00:48:16 +00:00
HeaderSearchTest.cpp [Lexer] Support adding working directory to relative search dir for #include shortening in HeaderSearch. 2018-01-29 13:21:23 +00:00
LexerTest.cpp PR37189 Fix incorrect end source location and spelling for a split '>>' token. 2018-04-30 05:25:48 +00:00
PPCallbacksTest.cpp Add #pragma clang module build/endbuild pragmas for performing a module build 2017-06-09 19:22:32 +00:00
PPConditionalDirectiveRecordTest.cpp Add #pragma clang module build/endbuild pragmas for performing a module build 2017-06-09 19:22:32 +00:00