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

Takuya Shimizu via cfe-commits cfe-commits at lists.llvm.org
Sun Sep 3 23:59:38 PDT 2023


hazohelet wrote:

When the `Loc` is higher than the lowest begin source location, `DisplayLineNo` still points to the lowest begin location line because we have
```c++
  DisplayLineNo =
        std::min(DisplayLineNo, SM.getPresumedLineNumber(I.getBegin()));
```
in L1169, correct?
This does not break the test added in the commit at least locally.

I don't think we need to ignore `Loc.getPresumedLoc().getLine()` when `Ranges` is not empty.

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


More information about the cfe-commits mailing list