This is an archive of the discontinued LLVM Phabricator instance.

[Basic] getColumnNumber returns location of CR+LF on Windows
ClosedPublic

Authored by chh on Apr 5 2017, 9:54 AM.

Details

Summary

When fixing a Clang-Tidy bug in D31406,
http://bugs.llvm.org/show_bug.cgi?id=32402,
reuse of FileID enabled the missing highlightRange function.
Assertion in highlightRange failed because the end-of-range column
number was 2 + the last column of a line on Windows.
This fix is required to enable D31406.

Diff Detail

Event Timeline

chh created this revision.Apr 5 2017, 9:54 AM
alexfh accepted this revision.Apr 6 2017, 2:12 AM

LG with one nit.

Thank you for tracking down this bug and fixing it!

lib/Basic/SourceManager.cpp
1154

I'd move this line before the outermost if and remove the identical line below.

This revision is now accepted and ready to land.Apr 6 2017, 2:12 AM
chh updated this revision to Diff 94402.Apr 6 2017, 11:19 AM
chh marked an inline comment as done.
This revision was automatically updated to reflect the committed changes.