[clang] [clang][Diagnostics] Fix wrong line number display (PR #65238)

via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 4 00:01:25 PDT 2023


cor3ntin wrote:

Ouch the inability to comment outside of modified code is going to be painful.

The changed code being

```cpp
  unsigned DisplayLineNo = Loc.getPresumedLoc().getLine();
  for (const auto &I : Ranges) {
  DisplayLineNo = 
            std::min(DisplayLineNo, SM.getPresumedLineNumber(I.getBegin()));
  }
```

If the range starts before `DisplayLineNo`, it still works. Am I missing something?

https://github.com/llvm/llvm-project/pull/65238


More information about the cfe-commits mailing list