llvm-project/clang/lib/Parse
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
ParseAST.cpp [Templight] Template Instantiation Observer 2018-02-10 14:04:45 +00:00
ParseCXXInlineMethods.cpp PR34163: Don't cache an incorrect key function for a class if queried between 2017-08-12 01:46:03 +00:00
ParseDecl.cpp Parse A::template B as an identifier rather than as a template-id with no 2018-04-27 02:00:13 +00:00
ParseDeclCXX.cpp Parse A::template B as an identifier rather than as a template-id with no 2018-04-27 02:00:13 +00:00
ParseExpr.cpp Parse A::template B as an identifier rather than as a template-id with no 2018-04-27 02:00:13 +00:00
ParseExprCXX.cpp Parse A::template B as an identifier rather than as a template-id with no 2018-04-27 02:00:13 +00:00
ParseInit.cpp Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC. 2017-06-01 21:23:52 +00:00
ParseObjc.cpp Revert rC330794 and some dependent tiny bug fixes 2018-04-26 00:42:40 +00:00
ParseOpenMP.cpp Parse A::template B as an identifier rather than as a template-id with no 2018-04-27 02:00:13 +00:00
ParsePragma.cpp Fix typos in clang 2018-04-06 15:14:32 +00:00
ParseStmt.cpp Sink PrettyDeclStackTrace down to the AST library 2018-03-23 00:07:18 +00:00
ParseStmtAsm.cpp Parse A::template B as an identifier rather than as a template-id with no 2018-04-27 02:00:13 +00:00
ParseTemplate.cpp PR37189 Fix incorrect end source location and spelling for a split '>>' token. 2018-04-30 05:25:48 +00:00
ParseTentative.cpp Revert rC330794 and some dependent tiny bug fixes 2018-04-26 00:42:40 +00:00
Parser.cpp Parse A::template B as an identifier rather than as a template-id with no 2018-04-27 02:00:13 +00:00