- Fixed toHalfOpenFileRange to work for macros as well as template
instantiations
- Added unit tests
Breaking test case for older version of toHalfOpenFileRange:
\# define FOO(X) X++
int a = 1;
int b = FOO(a);
toHalfOpenFileRange for the sourceRange of VarDecl for b returned the
wrong Range.
This isn't well-defined without more information, because a SourceRange may be token/char range etc.
(And in fact this appears to treat it as a half-open range, which isn't the most common type).
Because this is ambiguous, fairly rare, and simple, can we just inline it into the test where it's used instead?